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_Backend.h | |
parent | 3aff90f4a822fcf5d902bbfbcc9fa931d6191a8c (diff) | |
download | ATCD-c44379cc7d9c7aa113989237ab0f56db12aa5219.tar.gz |
Repo restructuring
Diffstat (limited to 'ACE/ace/Log_Msg_Backend.h')
-rw-r--r-- | ACE/ace/Log_Msg_Backend.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/ACE/ace/Log_Msg_Backend.h b/ACE/ace/Log_Msg_Backend.h new file mode 100644 index 00000000000..6203287011d --- /dev/null +++ b/ACE/ace/Log_Msg_Backend.h @@ -0,0 +1,68 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Log_Msg_Backend.h + * + * $Id$ + * + * @author Douglas C. Schmidt <schmidt@cs.wustl.edu> + */ +//============================================================================= + + +#ifndef ACE_LOG_MSG_BACKEND_H +#define ACE_LOG_MSG_BACKEND_H +#include /**/ "ace/pre.h" + +#include "ace/ACE_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +ACE_BEGIN_VERSIONED_NAMESPACE_DECL + +class ACE_Log_Record; + +/** + * @class ACE_Log_Msg_Backend + * + * @brief Define the interface for ACE_Log_Msg backend strategies. + * + * The ACE_Log_Msg class can log to multiple backend strategies, for + * example, some send messages to a remote logger, others dump to a + * file, or simply to stderr. In the future we could define + * interfaces that log to the syslog daemon (on UNIX), the Event log + * (on NT) a temporary ring buffer, etc. + */ +class ACE_Export ACE_Log_Msg_Backend +{ +public: + /// No-op virtual destructor. + virtual ~ACE_Log_Msg_Backend (void); + + /// Open a new connection + virtual int open (const ACE_TCHAR *logger_key) = 0; + + /* + * Reset the backend. When changing the logging destination the + * backend may need to properly disconnect from the remote logging + * daemon and reclaim some local resources. But we try to reduce + * the number of local allocations/deallocations. + */ + virtual int reset (void) = 0; + + /// Close the backend completely. + virtual int close (void) = 0; + + /// Backend routine. This is called when we want to log a message. + /// Since this routine is pure virtual, it must be overwritten by the + /// subclass. + virtual int log (ACE_Log_Record &log_record) = 0; +}; + +ACE_END_VERSIONED_NAMESPACE_DECL + +#include /**/ "ace/post.h" +#endif /* ACE_LOG_MSG_BACKEND_H */ |