Log_Msg_UNIX_Syslog.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Log_Msg_UNIX_Syslog.h
00006  *
00007  *  Log_Msg_UNIX_Syslog.h,v 4.6 2005/10/28 16:14:53 ossama Exp
00008  *
00009  *  @author Jerry D. De Master <jdemaster@rite-solutions.com>
00010  */
00011 //=============================================================================
00012 
00013 #ifndef ACE_LOG_MSG_UNIX_SYSLOG_H
00014 #define ACE_LOG_MSG_UNIX_SYSLOG_H
00015 #include /**/ "ace/pre.h"
00016 
00017 #include "ace/config-all.h"
00018 
00019 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00020 # pragma once
00021 #endif /* ACE_LACKS_PRAGMA_ONCE */
00022 
00023 #if !defined (ACE_LACKS_UNIX_SYSLOG)
00024 
00025 #include "ace/Log_Msg_Backend.h"
00026 
00027 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00028 
00029 /**
00030  * @class ACE_Log_Msg_UNIX_Syslog
00031  *
00032  * @brief Implements an ACE_Log_Msg_Backend that logs messages to a UNIX
00033  * system's syslog facility.
00034  */
00035 class ACE_Export ACE_Log_Msg_UNIX_Syslog : public ACE_Log_Msg_Backend
00036 {
00037 public:
00038   /// Constructor
00039   ACE_Log_Msg_UNIX_Syslog (void);
00040 
00041   /// Destructor
00042   virtual ~ACE_Log_Msg_UNIX_Syslog (void);
00043 
00044   /// Open a new event log.
00045   /**
00046    * Initialize the event logging facility.
00047    * @param logger_key The name of the calling program. This name is
00048    *                   used as the @c ident in the syslog entries. If
00049    *                   it is 0 (no name), the application name as
00050    *                   returned from ACE_Log_Msg::program_name() is used.
00051    */
00052   virtual int open (const ACE_TCHAR *logger_key);
00053 
00054   /// Reset the backend.
00055   virtual int reset (void);
00056 
00057   /// Close the backend completely.
00058   virtual int close (void);
00059 
00060   /// This is called when we want to log a message.
00061   virtual int log (ACE_Log_Record &log_record);
00062 
00063 private:
00064   /// Convert an ACE_Log_Priority value to the corresponding syslog priority.
00065   int convert_log_priority (ACE_UINT32 lm_priority);
00066 
00067   /// Convert an ACE_Log_Priority mask to the corresponding syslog mask value.
00068   int convert_log_mask (int lm_mask);
00069 };
00070 
00071 ACE_END_VERSIONED_NAMESPACE_DECL
00072 
00073 #endif /* !ACE_LACKS_UNIX_SYSLOG */
00074 
00075 #include /**/ "ace/post.h"
00076 #endif /* ACE_LOG_MSG_UNIX_SYSLOG_H */

Generated on Thu Nov 9 09:41:53 2006 for ACE by doxygen 1.3.6