Logging_Strategy.cpp File Reference

#include "ace/Logging_Strategy.h"
#include "ace/Service_Config.h"
#include "ace/ACE.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 87536 2009-11-13 00:37:58Z dai_y $") 1void ACE_Logging_Strategy

Function Documentation

ACE_RCSID ( ace  ,
Logging_Strategy  ,
"$Id: Logging_Strategy.cpp 87536 2009-11-13 00:37:58Z dai_y $"   
)

Definition at line 18 of file Logging_Strategy.cpp.

00020                : Logging_Strategy.cpp 87536 2009-11-13 00:37:58Z dai_y $")
00021 
00022 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00023 
00024 // Parse the string containing (thread) priorities and set them
00025 // accordingly.
00026 
00027 void
00028 ACE_Logging_Strategy::priorities (ACE_TCHAR *priority_string,
00029                                   ACE_Log_Msg::MASK_TYPE mask)
00030 {
00031   u_long priority_mask = 0;
00032 
00033   // Choose priority mask to change.
00034 
00035   if (mask == ACE_Log_Msg::PROCESS)
00036     priority_mask = process_priority_mask_;
00037   else
00038     priority_mask = thread_priority_mask_;
00039 
00040   ACE_TCHAR *strtokp = 0;
00041 
00042   // Parse string and alternate priority mask.
00043 
00044   for (ACE_TCHAR *priority = ACE_OS::strtok_r (priority_string,
00045                                                ACE_TEXT ("|"),
00046                                                &strtokp);
00047        priority != 0;
00048        priority = ACE_OS::strtok_r (0,
00049                                     ACE_TEXT ("|"),
00050                                     &strtokp))
00051     {
00052       if (ACE_OS::strcmp (priority, ACE_TEXT ("SHUTDOWN")) == 0)
00053         ACE_SET_BITS (priority_mask, LM_SHUTDOWN);
00054       else if (ACE_OS::strcmp (priority, ACE_TEXT ("~SHUTDOWN")) == 0)
00055         ACE_CLR_BITS (priority_mask, LM_SHUTDOWN);
00056       else if (ACE_OS::strcmp (priority, ACE_TEXT ("TRACE")) == 0)
00057         ACE_SET_BITS (priority_mask, LM_TRACE);
00058       else if (ACE_OS::strcmp (priority, ACE_TEXT ("~TRACE")) == 0)
00059         ACE_CLR_BITS (priority_mask, LM_TRACE);
00060       else if (ACE_OS::strcmp (priority, ACE_TEXT ("DEBUG")) == 0)
00061         ACE_SET_BITS (priority_mask, LM_DEBUG);
00062       else if (ACE_OS::strcmp (priority, ACE_TEXT ("~DEBUG")) == 0)
00063         ACE_CLR_BITS (priority_mask, LM_DEBUG);
00064       else if (ACE_OS::strcmp (priority, ACE_TEXT ("INFO")) == 0)
00065         ACE_SET_BITS (priority_mask, LM_INFO);
00066       else if (ACE_OS::strcmp (priority, ACE_TEXT ("~INFO")) == 0)
00067         ACE_CLR_BITS (priority_mask, LM_INFO);
00068       else if (ACE_OS::strcmp (priority, ACE_TEXT ("NOTICE")) == 0)
00069         ACE_SET_BITS (priority_mask, LM_NOTICE);
00070       else if (ACE_OS::strcmp (priority, ACE_TEXT ("~NOTICE")) == 0)
00071         ACE_CLR_BITS (priority_mask, LM_NOTICE);
00072       else if (ACE_OS::strcmp (priority, ACE_TEXT ("WARNING")) == 0)
00073         ACE_SET_BITS (priority_mask, LM_WARNING);
00074       else if (ACE_OS::strcmp (priority, ACE_TEXT ("~WARNING")) == 0)
00075         ACE_CLR_BITS (priority_mask, LM_WARNING);
00076       else if (ACE_OS::strcmp (priority, ACE_TEXT ("STARTUP")) == 0)
00077         ACE_SET_BITS (priority_mask, LM_STARTUP);
00078       else if (ACE_OS::strcmp (priority, ACE_TEXT ("~STARTUP")) == 0)
00079         ACE_CLR_BITS (priority_mask, LM_STARTUP);
00080       else if (ACE_OS::strcmp (priority, ACE_TEXT ("ERROR")) == 0)
00081         ACE_SET_BITS (priority_mask, LM_ERROR);
00082       else if (ACE_OS::strcmp (priority, ACE_TEXT ("~ERROR")) == 0)
00083         ACE_CLR_BITS (priority_mask, LM_ERROR);
00084       else if (ACE_OS::strcmp (priority, ACE_TEXT ("CRITICAL")) == 0)
00085         ACE_SET_BITS (priority_mask, LM_CRITICAL);
00086       else if (ACE_OS::strcmp (priority, ACE_TEXT ("~CRITICAL")) == 0)
00087         ACE_CLR_BITS (priority_mask, LM_CRITICAL);
00088       else if (ACE_OS::strcmp (priority, ACE_TEXT ("ALERT")) == 0)
00089         ACE_SET_BITS (priority_mask, LM_ALERT);
00090       else if (ACE_OS::strcmp (priority, ACE_TEXT ("~ALERT")) == 0)
00091         ACE_CLR_BITS (priority_mask, LM_ALERT);
00092       else if (ACE_OS::strcmp (priority, ACE_TEXT ("EMERGENCY")) == 0)
00093         ACE_SET_BITS (priority_mask, LM_EMERGENCY);
00094       else if (ACE_OS::strcmp (priority, ACE_TEXT ("~EMERGENCY")) == 0)
00095         ACE_CLR_BITS (priority_mask, LM_EMERGENCY);
00096     }
00097 
00098   // Affect right priority mask.
00099 
00100   if (mask == ACE_Log_Msg::PROCESS)
00101     process_priority_mask_ = priority_mask;
00102   else
00103     thread_priority_mask_ = priority_mask;
00104 }

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Sun Nov 22 23:11:01 2009 for ACE by  doxygen 1.6.1