ACE 8.0.0
|
Defines the structure of an ACE logging record. More...
#include <Log_Record.h>
Public Types | |
enum | { MAXLOGMSGLEN = ACE_MAXLOGMSGLEN+1 , ALIGN_WORDB = 8 , VERBOSE_LEN = 128 , MAXVERBOSELOGMSGLEN = VERBOSE_LEN + MAXLOGMSGLEN } |
Public Member Functions | |
ACE_Log_Record () | |
ACE_Log_Record (ACE_Log_Priority lp, time_t time_stamp, long pid) | |
ACE_Log_Record (ACE_Log_Priority lp, const ACE_Time_Value &time_stamp, long pid) | |
~ACE_Log_Record () | |
Default dtor. | |
int | print (const ACE_TCHAR host_name[], u_long verbose_flag, FILE *fp=stderr) |
int | print (const ACE_TCHAR host_name[], u_long verbose_flag, ACE_OSTREAM_TYPE &stream) |
int | format_msg (const ACE_TCHAR host_name[], u_long verbose_flag, ACE_TCHAR *verbose_msg, size_t verbose_msg_size) |
ACE_UINT32 | type () const |
Get the type of the Log_Record. | |
void | type (ACE_UINT32) |
Set the type of the Log_Record. | |
ACE_Log_Category_TSS * | category () const |
Get the category of the Log_Record. | |
void | category (ACE_Log_Category_TSS *) |
Set the category of the Log_Record. | |
u_long | priority () const |
void | priority (u_long num) |
long | length () const |
void | length (long) |
ACE_Time_Value | time_stamp () const |
Get the time stamp of the Log_Record. | |
void | time_stamp (const ACE_Time_Value &ts) |
Set the time stamp of the Log_Record. | |
long | pid () const |
Get the process id of the Log_Record. | |
void | pid (long) |
Set the process id of the Log_Record. | |
const ACE_TCHAR * | msg_data () const |
Get the message data of the Log_Record. | |
int | msg_data (const ACE_TCHAR *data) |
size_t | msg_data_len () const |
void | dump () const |
Dump the state of an object. | |
Static Public Member Functions | |
static const ACE_TCHAR * | priority_name (ACE_Log_Priority p) |
static void | priority_name (ACE_Log_Priority p, const ACE_TCHAR *name) |
IMPORTANT: name must be a statically allocated const ACE_TCHAR*. | |
Public Attributes | |
ACE_ALLOC_HOOK_DECLARE | |
Declare the dynamic allocation hooks. | |
Private Member Functions | |
void | round_up () |
Round up to the alignment restrictions. | |
ACE_Log_Record (const ACE_Log_Record &)=delete | |
ACE_Log_Record & | operator= (const ACE_Log_Record &)=delete |
ACE_Log_Record (ACE_Log_Record &&)=delete | |
ACE_Log_Record & | operator= (ACE_Log_Record &&rhs)=delete |
Private Attributes | |
ACE_INT32 | length_ |
ACE_UINT32 | type_ |
Type of logging record. | |
time_t | secs_ |
Time that the logging record was generated. | |
ACE_UINT32 | usecs_ |
ACE_UINT32 | pid_ |
Id of process that generated the logging record. | |
ACE_TCHAR * | msg_data_ |
Logging record data. | |
size_t | msg_data_size_ |
Allocated size of msg_data_ in ACE_TCHARs. | |
ACE_Log_Category_TSS * | category_ |
Defines the structure of an ACE logging record.
ACE_Log_Record::ACE_Log_Record | ( | ) |
Create a Log_Record and set its priority, time stamp, and process id.
ACE_Log_Record::ACE_Log_Record | ( | ACE_Log_Priority | lp, |
time_t | time_stamp, | ||
long | pid ) |
ACE_Log_Record::ACE_Log_Record | ( | ACE_Log_Priority | lp, |
const ACE_Time_Value & | time_stamp, | ||
long | pid ) |
|
inline |
Default dtor.
|
privatedelete |
|
privatedelete |
|
inline |
Get the category of the Log_Record.
|
inline |
Set the category of the Log_Record.
void ACE_Log_Record::dump | ( | ) | const |
Dump the state of an object.
int ACE_Log_Record::format_msg | ( | const ACE_TCHAR | host_name[], |
u_long | verbose_flag, | ||
ACE_TCHAR * | verbose_msg, | ||
size_t | verbose_msg_size ) |
|
inline |
Get the total length of the Log_Record, which includes the size of the various data member fields.
Set the total length of the Log_Record, which needs to account for the size of the various data member fields.
|
inline |
Get the message data of the Log_Record.
Set the message data of the record. If data is longer than the current msg_data_ buffer, a new msg_data_ buffer is allocated to fit. If such a reallocation fails, this method returns -1, else 0.
|
inline |
Get the size of the message data of the Log_Record, including a byte for the NUL.
|
privatedelete |
|
privatedelete |
|
inline |
Get the process id of the Log_Record.
int ACE_Log_Record::print | ( | const ACE_TCHAR | host_name[], |
u_long | verbose_flag, | ||
ACE_OSTREAM_TYPE & | stream ) |
Write the contents of the logging record to the appropriate stream if the corresponding type is enabled.
Write the contents of the logging record to the appropriate FILE if the corresponding type is enabled.
u_long ACE_Log_Record::priority | ( | ) | const |
Get the priority of the Log_Record <type_>. This is computed as the base 2 logarithm of <type_> (which must be a power of 2, as defined by the enums in ACE_Log_Priority).
Set the priority of the Log_Record <type_> (which must be a power of 2, as defined by the enums in ACE_Log_Priority).
|
static |
Returns a character array with the string form of the ACE_Log_Priority parameter. This is used for the verbose printing format.
|
static |
IMPORTANT: name must be a statically allocated const ACE_TCHAR*.
|
private |
Round up to the alignment restrictions.
|
inline |
Get the time stamp of the Log_Record.
|
inline |
Set the time stamp of the Log_Record.
|
inline |
Get the type of the Log_Record.
|
inline |
Set the type of the Log_Record.
ACE_Log_Record::ACE_ALLOC_HOOK_DECLARE |
Declare the dynamic allocation hooks.
|
private |
|
private |
Total length of the logging record in bytes. This field must come first in order for various IPC framing mechanisms to work correctly. In addition, the field must be an ACE_INT32 in order to be passed portable across platforms.
|
private |
Logging record data.
|
private |
Allocated size of msg_data_ in ACE_TCHARs.
|
private |
Id of process that generated the logging record.
|
private |
Time that the logging record was generated.
|
private |
Type of logging record.
|
private |