Skip to content

Commit f158ac6

Browse files
committed
Remove use of logging server in helloworld_server
1 parent 57cc902 commit f158ac6

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

examples/cpp/helloworld/helloworld_server.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include <iostream>
3838
#include <iomanip>
3939
#include <sstream>
40+
#include <future>
4041

4142
// the modulename is needed for the logger streams (streamDebug, streamInfo, streamWarning, streamError, streamCritical, streamFatal)
4243
#define MODULENAME "helloworld_server"
@@ -182,13 +183,16 @@ int main()
182183
EntityServer entityServer;
183184
entityContainer.registerEntity(&entityServer, "MyService");
184185

185-
SessionInfo sessionLog = entityContainer.connect("tcp://localhost:9200:headersize:protobuf");
186-
PeerId peerIdLog = entityServer.connect(sessionLog, "LoggingServer", [](PeerId peerId, Status status) {
187-
streamInfo << "Logging Server connect reply: " << status.toString();
188-
});
189-
Logger::instance().registerConsumer([&entityServer, peerIdLog](const LogContext& context, const char* text) {
190-
entityServer.sendEvent(peerIdLog, "log", LogEntry(currentISO8601TimeUTC(), "HelloWorldServer", context, text));
191-
});
186+
// SessionInfo sessionLog = entityContainer.connect("tcp://localhost:9200:headersize:protobuf");
187+
// PeerId peerIdLog = entityServer.connect(sessionLog, "LoggingServer", [](PeerId peerId, Status status) {
188+
// streamInfo << "Logging Server connect reply: " << status.toString();
189+
// });
190+
// ExecutorWorker<Executor> executorLogging(1);
191+
// Logger::instance().registerConsumer([&executorLogging, &entityServer, peerIdLog](const LogContext& context, const char* text) {
192+
// executorLogging.addAction([&entityServer, peerIdLog, context, text = std::string(text)]() {
193+
// entityServer.sendEvent(peerIdLog, "log", LogEntry(currentISO8601TimeUTC(), "HelloWorldServer", context, text.c_str()));
194+
// });
195+
// });
192196

193197
// register an entity for file download. The name "*" means that if an entity name, given by a client, is not found by name,
194198
// then this entity will try to open a file inside the htdocs directory. An entity name can contain slashes ('/')

0 commit comments

Comments
 (0)