Packets: Fix VariantParser invalid parser access bug
[senf.git] / Utils / Logger / SyslogTarget.hh
index bb1aa6c..786b58c 100644 (file)
@@ -23,8 +23,8 @@
 /** \file
     \brief SyslogTarget public header */
 
-#ifndef HH_SyslogTarget_
-#define HH_SyslogTarget_ 1
+#ifndef HH_SENF_Utils_Logger_SyslogTarget_
+#define HH_SENF_Utils_Logger_SyslogTarget_ 1
 
 // Custom includes
 #include <syslog.h>
 namespace senf {
 namespace log {
     
+    /** \brief Log target writing to the syslog
+
+        The SyslogTarget will send all log messages to the syslog at the given facility.
+
+        \code
+        senf::log::SyslogTarget syslog;
+
+        // Route all messages to the syslog
+        syslog.route();
+        \endcode
+
+        Valid facility values (taken from <tt>man 3 syslog</tt>):
+        \par "" 
+           <tt>LOG_AUTHPRIV</tt>, <tt>LOG_CRON</tt>, <tt>LOG_DAEMON</tt>, <tt>LOG_FTP</tt>,
+           <tt>LOG_KERN</tt>, <tt>LOG_LOCAL0</tt>, <tt>LOG_LOCAL1</tt>, <tt>LOG_LOCAL2</tt>,
+           <tt>LOG_LOCAL3</tt>, <tt>LOG_LOCAL4</tt>, <tt>LOG_LOCAL5</tt>, <tt>LOG_LOCAL6</tt>,
+           <tt>LOG_LOCAL7</tt>, <tt>LOG_LPR</tt>, <tt>LOG_MAIL</tt>, <tt>LOG_NEWS</tt>,
+           <tt>LOG_SYSLOG</tt>, <tt>LOG_USER</tt>, <tt>LOG_UUCP</tt>
+
+        The default facility is <tt>LOG_USER</tt>.
+
+        The SENF log levels are mapped to syslog levels in the following way:
+
+        <table class="senf fixedcolumn">
+        <tr><td>senf::log::VERBOSE</td>   <td>\c LOG_DEBUG</td></tr>
+        <tr><td>senf::log::NOTICE</td>    <td>\c LOG_INFO</td></tr>
+        <tr><td>senf::log::MESSAGE</td>   <td>\c LOG_NOTICE</td></tr>
+        <tr><td>senf::log::IMPORTANT</td> <td>\c LOG_WARNING</td></tr>
+        <tr><td>senf::log::CRITICAL</td>  <td>\c LOG_CRIT</td></tr>
+        <tr><td>senf::log::FATAL</td>     <td>\c LOG_EMERG</td></tr>
+        </table>
+
+        \ingroup targets
+     */
     class SyslogTarget 
         : public Target
     {
     public:
         ///////////////////////////////////////////////////////////////////////////
-        // Types
-
-
-        ///////////////////////////////////////////////////////////////////////////
         ///\name Structors and default members
         ///@{
 
@@ -53,12 +83,11 @@ namespace log {
         ///@}
         ///////////////////////////////////////////////////////////////////////////
 
-    protected:
+    private:
         void v_write(time_type timestamp, std::string const & stream, 
                      std::string const & area, unsigned level, 
                      std::string const & message);
 
-    private:
         int facility_;
         static int const LEVELMAP_[8];
     };