ACE
6.4.2
|
Provides a categorized message logging abstraction. More...
#include <Log_Category.h>
Public Member Functions | |
ACE_Log_Category (const char *name) | |
~ACE_Log_Category () | |
unsigned int | id () |
const char * | name () |
ACE_Log_Category_TSS * | per_thr_obj () |
u_long | priority_mask () |
Get the process ACE_Log_Priority mask. More... | |
u_long | priority_mask (u_long) |
Set the process ACE_Log_Priority mask, returns original mask. More... | |
Static Public Member Functions | |
static ACE_Log_Category & | ace_lib () |
Private Member Functions | |
ACE_Log_Category (const ACE_Log_Category &) | |
ACE_Log_Category & | operator= (const ACE_Log_Category &) |
Private Attributes | |
const char * | name_ |
unsigned int | id_ |
u_long | priority_mask_ |
ACE_Thread_Mutex | keylock_ |
Avoid race conditions during initialization. More... | |
ACE_thread_key_t | key_ |
Friends | |
class | ACE_Log_Category_TSS |
Provides a categorized message logging abstraction.
This class added another level of abstraction to ACE_Log_Msg
to separate log messages into different categories. Logs in different categories can be independently enabled or disabled. However, they will all be affected by the priority_mask setting in ACE_Log_Msg. That is to say, if a given priority level is disabled using ACE_Log_Msg::priority_mask()
, all messages of that priority level logged via any ACE_Log_Category
object would also be disabled regardless of the priority_mask
setting in the ACE_Log_Category
object.
Each cateogry can have a name which is fixed at construction. The name is not used for formating the messages. However, it can be used by a message backend object for identification and reformat accordingly.
To log a message into a category. Create a new ACE_Log_Category
and then use per_thr_obj()
for logging. For example,
ACE_Log_Category::ACE_Log_Category | ( | const char * | name | ) |
Initialize the logger with a name.
Notice that ACE_Log_Category does not deep copy the passed name; therefore, you must keep the lifetime of name longer than the newly create ACE_Log_Category object. The rational for the design is to avoid static initialization problem when the ACE_Log_Category is created in static storage.
Default per-process priority mask By default, all priorities are enabled.
ACE_Log_Category::~ACE_Log_Category | ( | ) |
|
private |
|
static |
|
inline |
|
inline |
|
private |
ACE_Log_Category_TSS * ACE_Log_Category::per_thr_obj | ( | ) |
|
inline |
Get the process ACE_Log_Priority mask.
Get the current ACE_Log_Priority mask.
|
inline |
Set the process ACE_Log_Priority mask, returns original mask.
Set the ACE_Log_Priority mask, returns original mask.
|
friend |
|
private |
|
private |
"First time in" flag. Key for the thread-specific error data.
|
private |
Avoid race conditions during initialization.
we couldn't directly use ACE_TSS because it would create circular dependency
|
private |
|
private |