@@ -637,12 +637,14 @@ class JSONMessage {
637637 // ! return a std::string for the log file
638638 virtual std::string msg () const = 0;
639639 // ! generate Boost log record to pass to corresponding sinks
640- virtual void log () const = 0 ;
640+ void log () const ;
641641 // ! create JSON-like output from the data
642642 const std::string json () const { return jsonify (data_); }
643643 void set (const std::string& key, const boost::any& value) { data_[key] = value; }
644644
645645protected:
646+ // ! generate Boost log record - this method is called by log()
647+ virtual void emitLog () const = 0;
646648 static std::string jsonify (const boost::any&);
647649
648650 std::map<std::string, boost::any> data_;
@@ -691,7 +693,7 @@ class StructuredMessage : public JSONMessage {
691693 // ! return a std::string for the log file
692694 std::string msg () const { return std::string (name) + std::string (" " ) + json (); }
693695 // ! generate Boost log record to pass to corresponding sinks
694- void log () const ;
696+ void emitLog () const ;
695697
696698protected:
697699 void addSubFields (const std::map<std::string, std::string>&);
@@ -720,7 +722,7 @@ class EventMessage : public JSONMessage {
720722 // ! return a std::string for the log file
721723 std::string msg () const { return std::string (name) + std::string (" " ) + json (); }
722724 // ! generate Boost log record to pass to corresponding sinks
723- void log () const ;
725+ void emitLog () const ;
724726
725727private:
726728 std::string message_;
@@ -735,7 +737,7 @@ class ProgressMessage : public JSONMessage {
735737 // ! return a std::string for the log file
736738 std::string msg () const { return std::string (name) + std::string (" " ) + json (); }
737739 // ! generate Boost log record to pass to corresponding sinks
738- void log () const ;
740+ void emitLog () const ;
739741};
740742
741743// ! Singleton to control console logging
0 commit comments