diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:30 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:30 +0000 |
commit | c44379cc7d9c7aa113989237ab0f56db12aa5219 (patch) | |
tree | 66a84b20d47f2269d8bdc6e0323f338763424d3a /ACE/ace/Log_Msg_UNIX_Syslog.h | |
parent | 3aff90f4a822fcf5d902bbfbcc9fa931d6191a8c (diff) | |
download | ATCD-c44379cc7d9c7aa113989237ab0f56db12aa5219.tar.gz |
Repo restructuring
Diffstat (limited to 'ACE/ace/Log_Msg_UNIX_Syslog.h')
-rw-r--r-- | ACE/ace/Log_Msg_UNIX_Syslog.h | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/ACE/ace/Log_Msg_UNIX_Syslog.h b/ACE/ace/Log_Msg_UNIX_Syslog.h new file mode 100644 index 00000000000..0031e043431 --- /dev/null +++ b/ACE/ace/Log_Msg_UNIX_Syslog.h @@ -0,0 +1,76 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Log_Msg_UNIX_Syslog.h + * + * $Id$ + * + * @author Jerry D. De Master <jdemaster@rite-solutions.com> + */ +//============================================================================= + +#ifndef ACE_LOG_MSG_UNIX_SYSLOG_H +#define ACE_LOG_MSG_UNIX_SYSLOG_H +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if !defined (ACE_LACKS_UNIX_SYSLOG) + +#include "ace/Log_Msg_Backend.h" + +ACE_BEGIN_VERSIONED_NAMESPACE_DECL + +/** + * @class ACE_Log_Msg_UNIX_Syslog + * + * @brief Implements an ACE_Log_Msg_Backend that logs messages to a UNIX + * system's syslog facility. + */ +class ACE_Export ACE_Log_Msg_UNIX_Syslog : public ACE_Log_Msg_Backend +{ +public: + /// Constructor + ACE_Log_Msg_UNIX_Syslog (void); + + /// Destructor + virtual ~ACE_Log_Msg_UNIX_Syslog (void); + + /// Open a new event log. + /** + * Initialize the event logging facility. + * @param logger_key The name of the calling program. This name is + * used as the @c ident in the syslog entries. If + * it is 0 (no name), the application name as + * returned from ACE_Log_Msg::program_name() is used. + */ + virtual int open (const ACE_TCHAR *logger_key); + + /// Reset the backend. + virtual int reset (void); + + /// Close the backend completely. + virtual int close (void); + + /// This is called when we want to log a message. + virtual int log (ACE_Log_Record &log_record); + +private: + /// Convert an ACE_Log_Priority value to the corresponding syslog priority. + int convert_log_priority (ACE_UINT32 lm_priority); + + /// Convert an ACE_Log_Priority mask to the corresponding syslog mask value. + int convert_log_mask (int lm_mask); +}; + +ACE_END_VERSIONED_NAMESPACE_DECL + +#endif /* !ACE_LACKS_UNIX_SYSLOG */ + +#include /**/ "ace/post.h" +#endif /* ACE_LOG_MSG_UNIX_SYSLOG_H */ |