X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FLogger%2FSyslogUDPTarget.hh;h=25bb8930c0657d9248206a1e7dbd4f4c7739b645;hb=b64ffc44397d5853a677a1b4494105c4756af8d3;hp=b9401535c4ff29cd5f96e5514617ebaaf2f6f85c;hpb=4195e3fc4bb545f2f7921396e2aec77edaa8c8c3;p=senf.git diff --git a/Utils/Logger/SyslogUDPTarget.hh b/Utils/Logger/SyslogUDPTarget.hh index b940153..25bb893 100644 --- a/Utils/Logger/SyslogUDPTarget.hh +++ b/Utils/Logger/SyslogUDPTarget.hh @@ -115,17 +115,27 @@ namespace log { using detail::LogFormat::timeFormat; using detail::LogFormat::tag; + bool syslog() const; ///< \c true, if using syslog format, \c false otherwise + /**< When syslog format is disabled, messages are not + formated as valid syslog messages but sent using plain + UDP. */ + void syslog(bool enabled=true); /// Set syslog format + private: + void init(); void v_write(time_type timestamp, std::string const & stream, std::string const & area, unsigned level, std::string const & message); + void consoleFormat(std::ostream & os); + int facility_; typedef senf::ClientSocketHandle< senf::MakeSocketPolicy< senf::DatagramFramingPolicy, senf::ConnectedCommunicationPolicy, senf::WriteablePolicy>::policy > Handle; Handle handle_; + bool syslogFormat_; public: enum LogFacility {