X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FUtils%2FLogger%2FSyslogUDPTarget.hh;h=e62ad763c705e734bcaad62f63898845fc1ae72f;hb=5b2e9a63a43027c71ac470ac9bdecb72e8974951;hp=71732d5ae9fa8269f973f6c751c5a77193b93dd3;hpb=601d1f509f5bb24df167a4dd5a20da67a0af9af8;p=senf.git diff --git a/senf/Utils/Logger/SyslogUDPTarget.hh b/senf/Utils/Logger/SyslogUDPTarget.hh index 71732d5..e62ad76 100644 --- a/senf/Utils/Logger/SyslogUDPTarget.hh +++ b/senf/Utils/Logger/SyslogUDPTarget.hh @@ -1,6 +1,6 @@ // $Id$ // -// Copyright (C) 2008 +// Copyright (C) 2008 // Fraunhofer Institute for Open Communication Systems (FOKUS) // Competence Center NETwork research (NET), St. Augustin, GERMANY // Stefan Bund @@ -27,29 +27,30 @@ #define HH_SENF_Utils_Logger_SyslogUDPTarget_ 1 // Custom includes -#include "SyslogTarget.hh" +#include #include "LogFormat.hh" -#include "../../Socket/Protocols/INet/INetAddressing.hh" -#include "../../Socket/ClientSocketHandle.hh" -#include "../../Socket/FramingPolicy.hh" -#include "../../Socket/ReadWritePolicy.hh" -#include "../../Socket/CommunicationPolicy.hh" +#include "Target.hh" +#include +#include +#include +#include +#include //#include "SyslogUDPTarget.mpp" -///////////////////////////////hh.p//////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// namespace senf { namespace log { /** \brief Log target writing UDP syslog packets - The SyslogUDPTarget will send all %log messages directly via UDP to a target host. This + The SyslogUDPTarget will send all %log messages directly via UDP to a target host. This host should have a syslog daemon or relay running. The protocol is defined in RFC-3164. - This log target has some important benefits: + This %log target has some important benefits: - \li It will never block. It may however lose log messages. + \li It will never block. It may however lose %log messages. \li It does \e not add timestamp information locally. These are \e advantages since this makes SyslogUDPTarget a very reliable high-performance @@ -57,7 +58,7 @@ namespace log { Valid facility values are from man 3 syslog: - \par "" + \par "" LOG_AUTHPRIV, LOG_CRON, LOG_DAEMON, LOG_FTP, LOG_KERN, LOG_LOCAL0, LOG_LOCAL1, LOG_LOCAL2, LOG_LOCAL3, LOG_LOCAL4, LOG_LOCAL5, LOG_LOCAL6, @@ -93,20 +94,20 @@ namespace log { : public Target, private detail::LogFormat { public: - /////////////////////////////////////////////////////////////////////////// + //-//////////////////////////////////////////////////////////////////////// // Types - /////////////////////////////////////////////////////////////////////////// + //-//////////////////////////////////////////////////////////////////////// ///\name Structors and default members - ///@{ + //\{ - explicit SyslogUDPTarget(senf::INet4Address const & target, int facility = LOG_USER); - explicit SyslogUDPTarget(senf::INet4SocketAddress const & target, int facility = LOG_USER); - explicit SyslogUDPTarget(senf::INet6Address const & target, int facility = LOG_USER); - explicit SyslogUDPTarget(senf::INet6SocketAddress const & target, int facility = LOG_USER); + explicit SyslogUDPTarget(INet4Address const & target, int facility = LOG_USER); + explicit SyslogUDPTarget(INet4SocketAddress const & target, int facility = LOG_USER); + explicit SyslogUDPTarget(INet6Address const & target, int facility = LOG_USER); + explicit SyslogUDPTarget(INet6SocketAddress const & target, int facility = LOG_USER); - ///@} - /////////////////////////////////////////////////////////////////////////// + //\} + //-//////////////////////////////////////////////////////////////////////// using detail::LogFormat::showTime; using detail::LogFormat::showStream; @@ -122,9 +123,9 @@ namespace log { 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, + 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); @@ -138,7 +139,7 @@ namespace log { bool syslogFormat_; public: - enum LogFacility { + enum LogFacility { AUTHPRIV = LOG_AUTHPRIV, CRON = LOG_CRON, DAEMON = LOG_DAEMON, @@ -164,21 +165,21 @@ namespace log { struct RegisterConsole { RegisterConsole(); - static boost::shared_ptr create( - senf::INet4SocketAddress const & target, LogFacility facility = USER); - static boost::shared_ptr create( - senf::INet4Address const & target, LogFacility facility = USER); - static boost::shared_ptr create( - senf::INet6SocketAddress const & target, LogFacility facility = USER); - static boost::shared_ptr create( - senf::INet6Address const & target, LogFacility facility = USER); + static boost::shared_ptr create( + INet4SocketAddress const & target, LogFacility facility = USER); + static boost::shared_ptr create( + INet4Address const & target, LogFacility facility = USER); + static boost::shared_ptr create( + INet6SocketAddress const & target, LogFacility facility = USER); + static boost::shared_ptr create( + INet6Address const & target, LogFacility facility = USER); static RegisterConsole instance; }; }; }} -///////////////////////////////hh.e//////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// #include "SyslogUDPTarget.cci" //#include "SyslogUDPTarget.ct" //#include "SyslogUDPTarget.cti"