ACE_Log_Msg_Manager Class Reference

Synchronize output operations. More...

Collaboration diagram for ACE_Log_Msg_Manager:

Collaboration graph
[legend]
List of all members.

Static Public Member Functions

static int init_backend (const u_long *flags=0)

Static Public Attributes

static ACE_Log_Msg_Backendlog_backend_ = 0
static ACE_Log_Msg_Backendcustom_backend_ = 0
static u_long log_backend_flags_ = 0

Detailed Description

Synchronize output operations.

Provides global point of contact for all ACE_Log_Msg instances in a process.

For internal use by ACE, only!

Definition at line 127 of file Log_Msg.cpp.


Member Function Documentation

int ACE_Log_Msg_Manager::init_backend ( const u_long *  flags = 0  )  [static]

Definition at line 154 of file Log_Msg.cpp.

References ACE_BIT_DISABLED, ACE_BIT_ENABLED, ACE_LOG_MSG_SYSLOG_BACKEND, ACE_NEW_RETURN, ACE_NO_HEAP_CHECK, ACE_Log_Msg::CUSTOM, custom_backend_, log_backend_, and ACE_Log_Msg::SYSLOG.

Referenced by ACE_Log_Msg::dump(), ACE_Log_Msg::instance(), ACE_Log_Msg::log(), and ACE_Log_Msg::open().

00155 {
00156   // If flags have been supplied, and they are different from the flags
00157   // we had last time, then we may have to re-create the backend as a
00158   // different type.
00159   if (flags)
00160     {
00161       // Sanity check for custom backend.
00162       if (ACE_BIT_ENABLED (*flags, ACE_Log_Msg::CUSTOM) &&
00163           ACE_Log_Msg_Manager::custom_backend_ == 0)
00164         {
00165           return -1;
00166         }
00167 
00168       if ((ACE_BIT_ENABLED (*flags, ACE_Log_Msg::SYSLOG)
00169             && ACE_BIT_DISABLED (ACE_Log_Msg_Manager::log_backend_flags_, ACE_Log_Msg::SYSLOG))
00170           || (ACE_BIT_DISABLED (*flags, ACE_Log_Msg::SYSLOG)
00171             && ACE_BIT_ENABLED (ACE_Log_Msg_Manager::log_backend_flags_, ACE_Log_Msg::SYSLOG)))
00172         {
00173           delete ACE_Log_Msg_Manager::log_backend_;
00174           ACE_Log_Msg_Manager::log_backend_ = 0;
00175         }
00176 
00177       ACE_Log_Msg_Manager::log_backend_flags_ = *flags;
00178     }
00179 
00180   if (ACE_Log_Msg_Manager::log_backend_ == 0)
00181     {
00182       ACE_NO_HEAP_CHECK;
00183 
00184 #if (defined (WIN32) || !defined (ACE_LACKS_UNIX_SYSLOG)) && !defined (ACE_HAS_WINCE) && !defined (ACE_HAS_PHARLAP)
00185       // Allocate the ACE_Log_Msg_Backend instance.
00186       if (ACE_BIT_ENABLED (ACE_Log_Msg_Manager::log_backend_flags_, ACE_Log_Msg::SYSLOG))
00187         ACE_NEW_RETURN (ACE_Log_Msg_Manager::log_backend_,
00188                         ACE_LOG_MSG_SYSLOG_BACKEND,
00189                         -1);
00190       else
00191 #endif /* defined (WIN32) && !defined (ACE_HAS_WINCE) && !defined (ACE_HAS_PHARLAP) */
00192         ACE_NEW_RETURN (ACE_Log_Msg_Manager::log_backend_,
00193                         ACE_Log_Msg_IPC,
00194                         -1);
00195     }
00196 
00197   return 0;
00198 }


Member Data Documentation

ACE_Log_Msg_Backend * ACE_Log_Msg_Manager::custom_backend_ = 0 [static]

Definition at line 131 of file Log_Msg.cpp.

Referenced by init_backend(), ACE_Log_Msg::log(), ACE_Log_Msg::msg_backend(), ACE_Log_Msg::open(), and ACE_Log_Msg::~ACE_Log_Msg().

ACE_Log_Msg_Backend * ACE_Log_Msg_Manager::log_backend_ = 0 [static]

Definition at line 130 of file Log_Msg.cpp.

Referenced by init_backend(), ACE_Log_Msg::log(), ACE_Log_Msg::open(), and ACE_Log_Msg::~ACE_Log_Msg().

u_long ACE_Log_Msg_Manager::log_backend_flags_ = 0 [static]

Definition at line 133 of file Log_Msg.cpp.


The documentation for this class was generated from the following file:
Generated on Tue Feb 2 17:35:15 2010 for ACE by  doxygen 1.4.7