Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

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 Methods

int init_backend (const u_long *flags=0)

Static Public Attributes

ACE_Log_Msg_Backendlog_backend_ = 0
ACE_Log_Msg_Backendcustom_backend_ = 0
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 93 of file Log_Msg.cpp.


Member Function Documentation

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

Definition at line 118 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_, log_backend_flags_, and ACE_Log_Msg::SYSLOG.

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

00119 {
00120   // If flags have been supplied, and they are different from the flags
00121   // we had last time, then we may have to re-create the backend as a
00122   // different type.
00123   if (flags)
00124     {
00125       // Sanity check for custom backend.
00126       if (ACE_BIT_ENABLED (*flags, ACE_Log_Msg::CUSTOM) &&
00127           ACE_Log_Msg_Manager::custom_backend_ == 0)
00128         {
00129           return -1;
00130         }
00131 
00132       if ((ACE_BIT_ENABLED (*flags, ACE_Log_Msg::SYSLOG)
00133             && ACE_BIT_DISABLED (ACE_Log_Msg_Manager::log_backend_flags_, ACE_Log_Msg::SYSLOG))
00134           || (ACE_BIT_DISABLED (*flags, ACE_Log_Msg::SYSLOG)
00135             && ACE_BIT_ENABLED (ACE_Log_Msg_Manager::log_backend_flags_, ACE_Log_Msg::SYSLOG)))
00136         {
00137           delete ACE_Log_Msg_Manager::log_backend_;
00138           ACE_Log_Msg_Manager::log_backend_ = 0;
00139         }
00140 
00141       ACE_Log_Msg_Manager::log_backend_flags_ = *flags;
00142     }
00143 
00144   if (ACE_Log_Msg_Manager::log_backend_ == 0)
00145     {
00146       ACE_NO_HEAP_CHECK;
00147 
00148 #if (defined (WIN32) || !defined (ACE_LACKS_UNIX_SYSLOG)) && !defined (ACE_HAS_WINCE) && !defined (ACE_HAS_PHARLAP)
00149       // Allocate the ACE_Log_Msg_Backend instance.
00150       if (ACE_BIT_ENABLED (ACE_Log_Msg_Manager::log_backend_flags_, ACE_Log_Msg::SYSLOG))
00151         ACE_NEW_RETURN (ACE_Log_Msg_Manager::log_backend_,
00152                         ACE_LOG_MSG_SYSLOG_BACKEND,
00153                         -1);
00154       else
00155 #endif /* defined (WIN32) && !defined (ACE_HAS_WINCE) && !defined (ACE_HAS_PHARLAP) */
00156         ACE_NEW_RETURN (ACE_Log_Msg_Manager::log_backend_,
00157                         ACE_Log_Msg_IPC,
00158                         -1);
00159     }
00160 
00161   return 0;
00162 }


Member Data Documentation

ACE_Log_Msg_Backend * ACE_Log_Msg_Manager::custom_backend_ = 0 [static]
 

Definition at line 114 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 113 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 116 of file Log_Msg.cpp.

Referenced by init_backend.


The documentation for this class was generated from the following file:
Generated on Mon Jun 16 12:49:33 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002