diff --git a/src/logging/Manager.cc b/src/logging/Manager.cc index 5bebdebdfb..8c720137e8 100644 --- a/src/logging/Manager.cc +++ b/src/logging/Manager.cc @@ -1207,7 +1207,11 @@ WriterFrontend* Manager::CreateWriter(EnumVal* id, EnumVal* writer, WriterBacken winfo->info->rotation_interval = winfo->interval; winfo->info->rotation_base = parse_rotate_base_time(base_time); +#ifdef ENABLE_BROKER winfo->writer = new WriterFrontend(*winfo->info, id, writer, local, remote, stream->remote_flags); +#else + winfo->writer = new WriterFrontend(*winfo->info, id, writer, local, remote, 0); +#endif winfo->writer->Init(num_fields, fields); InstallRotationTimer(winfo); diff --git a/src/logging/Manager.h b/src/logging/Manager.h index 6852160169..3334942a3a 100644 --- a/src/logging/Manager.h +++ b/src/logging/Manager.h @@ -131,7 +131,7 @@ public: /** * Create a new log writer frontend. This is exposed so that the - * communication system can recreated remote log streams locally. + * communication system can recreate remote log streams locally. * * @param stream The enum value corresponding the log stream. * @@ -153,7 +153,7 @@ public: /** * Writes out log entries that have already passed through all - * filters, and have raised any events. This is meant called for logs + * filters (and have raised any events). This is meant called for logs * received alrready processed from remote. * * @param stream The enum value corresponding the log stream. diff --git a/src/logging/WriterBackend.cc b/src/logging/WriterBackend.cc index 624b66b8e8..e2afd360e7 100644 --- a/src/logging/WriterBackend.cc +++ b/src/logging/WriterBackend.cc @@ -119,6 +119,7 @@ bool WriterBackend::WriterInfo::Write(SerializationFormat* fmt) const return true; } +#ifdef ENABLE_BROKER broker::data WriterBackend::WriterInfo::ToBroker() const { auto bpath = broker::record::field(path); @@ -175,6 +176,7 @@ bool WriterBackend::WriterInfo::FromBroker(broker::data d) return true; } +#endif WriterBackend::WriterBackend(WriterFrontend* arg_frontend) : MsgThread() { diff --git a/src/logging/WriterBackend.h b/src/logging/WriterBackend.h index e17b7070c1..f6602cc8ca 100644 --- a/src/logging/WriterBackend.h +++ b/src/logging/WriterBackend.h @@ -6,7 +6,10 @@ #define LOGGING_WRITERBACKEND_H #include "threading/MsgThread.h" + +#ifdef ENABLE_BROKER #include "broker/Data.h" +#endif #include "Component.h" @@ -115,8 +118,11 @@ public: // fields. They serialize/deserialize the struct. bool Read(SerializationFormat* fmt); bool Write(SerializationFormat* fmt) const; + +#ifdef ENABLE_BROKER broker::data ToBroker() const; bool FromBroker(broker::data d); +#endif private: const WriterInfo& operator=(const WriterInfo& other); // Disable. diff --git a/src/logging/WriterFrontend.cc b/src/logging/WriterFrontend.cc index 05f4f6593a..0c2378890f 100644 --- a/src/logging/WriterFrontend.cc +++ b/src/logging/WriterFrontend.cc @@ -214,12 +214,14 @@ void WriterFrontend::Write(int arg_num_fields, Value** vals) num_fields, vals); +#ifdef ENABLE_BROKER broker_mgr->Log(stream, writer, info->path, num_fields, vals, remote_flags); +#endif } if ( ! backend )