Functions

Logging_Strategy.cpp File Reference

#include "ace/Logging_Strategy.h"
#include "ace/Service_Config.h"
#include "ace/ACE.h"
#include "ace/ACE_export.h"
#include "ace/Get_Opt.h"
#include "ace/streams.h"
#include "ace/Lib_Find.h"
#include "ace/Log_Msg.h"
#include "ace/Reactor.h"
#include "ace/OS_NS_string.h"
#include "ace/OS_NS_stdio.h"
#include "ace/OS_NS_unistd.h"
Include dependency graph for Logging_Strategy.cpp:

Go to the source code of this file.

Functions

 ACE_RCSID (ace, Logging_Strategy,"$Id: Logging_Strategy.cpp 90712 2010-06-18 20:01:29Z shuston $") 1void ACE_Logging_Strategy
 ACE_STATIC_SVC_DEFINE (ACE_Logging_Strategy, ACE_TEXT("Logging_Strategy"), ACE_Service_Type::SERVICE_OBJECT,&ACE_SVC_NAME(ACE_Logging_Strategy), ACE_Service_Type::DELETE_THIS|ACE_Service_Type::DELETE_OBJ, 0) extern"C"ACE_Export int _get_dll_unload_policy()

Function Documentation

ACE_RCSID ( ace  ,
Logging_Strategy  ,
"$Id: Logging_Strategy.cpp 90712 2010-06-18 20:01:29Z shuston $"   
)

Definition at line 19 of file Logging_Strategy.cpp.

               : Logging_Strategy.cpp 90712 2010-06-18 20:01:29Z shuston $")

ACE_BEGIN_VERSIONED_NAMESPACE_DECL

// Parse the string containing (thread) priorities and set them
// accordingly.

void
ACE_Logging_Strategy::priorities (ACE_TCHAR *priority_string,
                                  ACE_Log_Msg::MASK_TYPE mask)
{
  u_long priority_mask = 0;

  // Choose priority mask to change.

  if (mask == ACE_Log_Msg::PROCESS)
    priority_mask = process_priority_mask_;
  else
    priority_mask = thread_priority_mask_;

  ACE_TCHAR *strtokp = 0;

  // Parse string and alternate priority mask.

  for (ACE_TCHAR *priority = ACE_OS::strtok_r (priority_string,
                                               ACE_TEXT ("|"),
                                               &strtokp);
       priority != 0;
       priority = ACE_OS::strtok_r (0,
                                    ACE_TEXT ("|"),
                                    &strtokp))
    {
      if (ACE_OS::strcmp (priority, ACE_TEXT ("SHUTDOWN")) == 0)
        ACE_SET_BITS (priority_mask, LM_SHUTDOWN);
      else if (ACE_OS::strcmp (priority, ACE_TEXT ("~SHUTDOWN")) == 0)
        ACE_CLR_BITS (priority_mask, LM_SHUTDOWN);
      else if (ACE_OS::strcmp (priority, ACE_TEXT ("TRACE")) == 0)
        ACE_SET_BITS (priority_mask, LM_TRACE);
      else if (ACE_OS::strcmp (priority, ACE_TEXT ("~TRACE")) == 0)
        ACE_CLR_BITS (priority_mask, LM_TRACE);
      else if (ACE_OS::strcmp (priority, ACE_TEXT ("DEBUG")) == 0)
        ACE_SET_BITS (priority_mask, LM_DEBUG);
      else if (ACE_OS::strcmp (priority, ACE_TEXT ("~DEBUG")) == 0)
        ACE_CLR_BITS (priority_mask, LM_DEBUG);
      else if (ACE_OS::strcmp (priority, ACE_TEXT ("INFO")) == 0)
        ACE_SET_BITS (priority_mask, LM_INFO);
      else if (ACE_OS::strcmp (priority, ACE_TEXT ("~INFO")) == 0)
        ACE_CLR_BITS (priority_mask, LM_INFO);
      else if (ACE_OS::strcmp (priority, ACE_TEXT ("NOTICE")) == 0)
        ACE_SET_BITS (priority_mask, LM_NOTICE);
      else if (ACE_OS::strcmp (priority, ACE_TEXT ("~NOTICE")) == 0)
        ACE_CLR_BITS (priority_mask, LM_NOTICE);
      else if (ACE_OS::strcmp (priority, ACE_TEXT ("WARNING")) == 0)
        ACE_SET_BITS (priority_mask, LM_WARNING);
      else if (ACE_OS::strcmp (priority, ACE_TEXT ("~WARNING")) == 0)
        ACE_CLR_BITS (priority_mask, LM_WARNING);
      else if (ACE_OS::strcmp (priority, ACE_TEXT ("STARTUP")) == 0)
        ACE_SET_BITS (priority_mask, LM_STARTUP);
      else if (ACE_OS::strcmp (priority, ACE_TEXT ("~STARTUP")) == 0)
        ACE_CLR_BITS (priority_mask, LM_STARTUP);
      else if (ACE_OS::strcmp (priority, ACE_TEXT ("ERROR")) == 0)
        ACE_SET_BITS (priority_mask, LM_ERROR);
      else if (ACE_OS::strcmp (priority, ACE_TEXT ("~ERROR")) == 0)
        ACE_CLR_BITS (priority_mask, LM_ERROR);
      else if (ACE_OS::strcmp (priority, ACE_TEXT ("CRITICAL")) == 0)
        ACE_SET_BITS (priority_mask, LM_CRITICAL);
      else if (ACE_OS::strcmp (priority, ACE_TEXT ("~CRITICAL")) == 0)
        ACE_CLR_BITS (priority_mask, LM_CRITICAL);
      else if (ACE_OS::strcmp (priority, ACE_TEXT ("ALERT")) == 0)
        ACE_SET_BITS (priority_mask, LM_ALERT);
      else if (ACE_OS::strcmp (priority, ACE_TEXT ("~ALERT")) == 0)
        ACE_CLR_BITS (priority_mask, LM_ALERT);
      else if (ACE_OS::strcmp (priority, ACE_TEXT ("EMERGENCY")) == 0)
        ACE_SET_BITS (priority_mask, LM_EMERGENCY);
      else if (ACE_OS::strcmp (priority, ACE_TEXT ("~EMERGENCY")) == 0)
        ACE_CLR_BITS (priority_mask, LM_EMERGENCY);
    }

  // Affect right priority mask.

  if (mask == ACE_Log_Msg::PROCESS)
    process_priority_mask_ = priority_mask;
  else
    thread_priority_mask_ = priority_mask;
}

ACE_STATIC_SVC_DEFINE ( ACE_Logging_Strategy  ,
ACE_TEXT("Logging_Strategy")  ,
ACE_Service_Type::SERVICE_OBJECT  ,
ACE_SVC_NAMEACE_Logging_Strategy,
ACE_Service_Type::DELETE_THIS|ACE_Service_Type::DELETE_OBJ  ,
 
)

Definition at line 599 of file Logging_Strategy.cpp.

{
  return ACE_DLL_UNLOAD_POLICY_LAZY;
}

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines