Static Public Member Functions | Static Public Attributes

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 121 of file Log_Msg.cpp.


Member Function Documentation

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

Definition at line 148 of file Log_Msg.cpp.

{
  // If flags have been supplied, and they are different from the flags
  // we had last time, then we may have to re-create the backend as a
  // different type.
  if (flags)
    {
      // Sanity check for custom backend.
      if (ACE_BIT_ENABLED (*flags, ACE_Log_Msg::CUSTOM) &&
          ACE_Log_Msg_Manager::custom_backend_ == 0)
        {
          return -1;
        }

      if ((ACE_BIT_ENABLED (*flags, ACE_Log_Msg::SYSLOG)
            && ACE_BIT_DISABLED (ACE_Log_Msg_Manager::log_backend_flags_, ACE_Log_Msg::SYSLOG))
          || (ACE_BIT_DISABLED (*flags, ACE_Log_Msg::SYSLOG)
            && ACE_BIT_ENABLED (ACE_Log_Msg_Manager::log_backend_flags_, ACE_Log_Msg::SYSLOG)))
        {
          delete ACE_Log_Msg_Manager::log_backend_;
          ACE_Log_Msg_Manager::log_backend_ = 0;
        }

      ACE_Log_Msg_Manager::log_backend_flags_ = *flags;
    }

  if (ACE_Log_Msg_Manager::log_backend_ == 0)
    {
      ACE_NO_HEAP_CHECK;

#if (defined (WIN32) || !defined (ACE_LACKS_UNIX_SYSLOG)) && !defined (ACE_HAS_WINCE) && !defined (ACE_HAS_PHARLAP)
      // Allocate the ACE_Log_Msg_Backend instance.
      if (ACE_BIT_ENABLED (ACE_Log_Msg_Manager::log_backend_flags_, ACE_Log_Msg::SYSLOG))
        ACE_NEW_RETURN (ACE_Log_Msg_Manager::log_backend_,
                        ACE_LOG_MSG_SYSLOG_BACKEND,
                        -1);
      else
#endif /* defined (WIN32) && !defined (ACE_HAS_WINCE) && !defined (ACE_HAS_PHARLAP) */
        ACE_NEW_RETURN (ACE_Log_Msg_Manager::log_backend_,
                        ACE_Log_Msg_IPC,
                        -1);
    }

  return 0;
}


Member Data Documentation

Definition at line 125 of file Log_Msg.cpp.

Definition at line 124 of file Log_Msg.cpp.

Definition at line 127 of file Log_Msg.cpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines