ACE_Log_Record Class Reference

Defines the structure of an ACE logging record. More...

#include <Log_Record.h>

List of all members.

Public Types

 MAXLOGMSGLEN = ACE_MAXLOGMSGLEN+1
 Maximum size of a logging message.
 ALIGN_WORDB = 8
 Most restrictive alignment.
 VERBOSE_LEN = 128
 MAXVERBOSELOGMSGLEN = VERBOSE_LEN + MAXLOGMSGLEN
 Maximum size of a logging message with the verbose headers.
enum  { MAXLOGMSGLEN = ACE_MAXLOGMSGLEN+1, ALIGN_WORDB = 8, VERBOSE_LEN = 128, MAXVERBOSELOGMSGLEN = VERBOSE_LEN + MAXLOGMSGLEN }

Public Member Functions

 ACE_Log_Record (void)
 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 (void)
 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)
void encode (void)
void decode (void)
ACE_UINT32 type (void) const
 Get the type of the <Log_Record>.
void type (ACE_UINT32)
 Set the type of the <Log_Record>.
u_long priority (void) const
void priority (u_long num)
long length (void) const
void length (long)
ACE_Time_Value time_stamp (void) 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 (void) const
 Get the process id of the <Log_Record>.
void pid (long)
 Set the process id of the <Log_Record>.
const ACE_TCHARmsg_data (void) const
 Get the message data of the <Log_Record>.
int msg_data (const ACE_TCHAR *data)
size_t msg_data_len (void) const
void dump (void) const
 Dump the state of an object.

Static Public Member Functions

static const ACE_TCHARpriority_name (ACE_Log_Priority p)
static void priority_name (ACE_Log_Priority p, const ACE_TCHAR *name)

Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.

Private Member Functions

void round_up (void)
 Round up to the alignment restrictions.
 ACE_Log_Record (const ACE_Log_Record &rhs)
 disallow copying...
ACE_Log_Recordoperator= (const ACE_Log_Record &rhs)

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_TCHARmsg_data_
 Logging record data.
size_t msg_data_size_


Detailed Description

Defines the structure of an ACE logging record.

Definition at line 37 of file Log_Record.h.


Member Enumeration Documentation

anonymous enum

Enumerator:
MAXLOGMSGLEN  Maximum size of a logging message.
ALIGN_WORDB  Most restrictive alignment.
VERBOSE_LEN  Size used by verbose mode. 20 (date) + 15 (host_name) + 10 (pid) + 10 (type) + 4 (@) ... + ? (progname)
MAXVERBOSELOGMSGLEN  Maximum size of a logging message with the verbose headers.

Definition at line 40 of file Log_Record.h.

00041   {
00042     /// Maximum size of a logging message.
00043     MAXLOGMSGLEN = ACE_MAXLOGMSGLEN+1,
00044 
00045     /// Most restrictive alignment.
00046     ALIGN_WORDB  = 8,
00047 
00048     /// Size used by verbose mode.
00049     /// 20 (date) + 15 (host_name) + 10 (pid) + 10 (type)
00050     ///           + 4 (@) ... + ? (progname)
00051     VERBOSE_LEN = 128,
00052 
00053     /// Maximum size of a logging message with the verbose headers
00054     MAXVERBOSELOGMSGLEN = VERBOSE_LEN + MAXLOGMSGLEN
00055   };


Constructor & Destructor Documentation

ACE_Log_Record::ACE_Log_Record ( void   ) 

Create a <Log_Record> and set its priority, time stamp, and process id.

Definition at line 196 of file Log_Record.cpp.

References ACE_NEW_NORETURN, MAXLOGMSGLEN, msg_data_, and msg_data_size_.

00197   : length_ (0),
00198     type_ (0),
00199     secs_ (0),
00200     usecs_ (0),
00201     pid_ (0),
00202     msg_data_ (0),
00203     msg_data_size_ (0)
00204 {
00205   // ACE_TRACE ("ACE_Log_Record::ACE_Log_Record");
00206   ACE_NEW_NORETURN (this->msg_data_, ACE_TCHAR[MAXLOGMSGLEN]);
00207   if (0 != this->msg_data_)
00208     {
00209       this->msg_data_size_ = MAXLOGMSGLEN;
00210       this->msg_data_[0] = '\0';
00211     }
00212 }

ACE_Log_Record::ACE_Log_Record ( ACE_Log_Priority  lp,
time_t  time_stamp,
long  pid 
)

Definition at line 143 of file Log_Record.cpp.

References ACE_NEW_NORETURN, MAXLOGMSGLEN, msg_data_, and msg_data_size_.

00146   : length_ (0),
00147     type_ (ACE_UINT32 (lp)),
00148     secs_ (ts_sec),
00149     usecs_ (0),
00150     pid_ (ACE_UINT32 (p)),
00151     msg_data_ (0),
00152     msg_data_size_ (0)
00153 {
00154   // ACE_TRACE ("ACE_Log_Record::ACE_Log_Record");
00155   ACE_NEW_NORETURN (this->msg_data_, ACE_TCHAR[MAXLOGMSGLEN]);
00156   if (0 != this->msg_data_)
00157     {
00158       this->msg_data_size_ = MAXLOGMSGLEN;
00159       this->msg_data_[0] = '\0';
00160     }
00161 }

ACE_Log_Record::ACE_Log_Record ( ACE_Log_Priority  lp,
const ACE_Time_Value time_stamp,
long  pid 
)

Definition at line 163 of file Log_Record.cpp.

References ACE_NEW_NORETURN, MAXLOGMSGLEN, msg_data_, and msg_data_size_.

00166   : length_ (0),
00167     type_ (ACE_UINT32 (lp)),
00168     secs_ (ts.sec ()),
00169     usecs_ ((ACE_UINT32) ts.usec ()),
00170     pid_ (ACE_UINT32 (p)),
00171     msg_data_ (0),
00172     msg_data_size_ (0)
00173 {
00174   // ACE_TRACE ("ACE_Log_Record::ACE_Log_Record");
00175   ACE_NEW_NORETURN (this->msg_data_, ACE_TCHAR[MAXLOGMSGLEN]);
00176   if (0 != this->msg_data_)
00177     {
00178       this->msg_data_size_ = MAXLOGMSGLEN;
00179       this->msg_data_[0] = '\0';
00180     }
00181 }

ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE ACE_Log_Record::~ACE_Log_Record ( void   ) 

Default dtor.

Definition at line 13 of file Log_Record.inl.

References msg_data_.

00014 {
00015   if (this->msg_data_)
00016     delete [] this->msg_data_;
00017 }

ACE_Log_Record::ACE_Log_Record ( const ACE_Log_Record rhs  )  [private]

disallow copying...


Member Function Documentation

ACE_INLINE void ACE_Log_Record::decode ( void   ) 

Decode the <Log_Record> received from the network.

Deprecated:
The encode() and decode() metods are deprecated; please use the CDR insertion and extraction operators to properly encode and decode ACE_Log_Record objects.

Definition at line 37 of file Log_Record.inl.

References ACE_TRACE, length_, pid_, ACE_Time_Value::sec(), secs_, type_, ACE_Time_Value::usec(), and usecs_.

00038 {
00039   ACE_TRACE ("ACE_Log_Record::decode");
00040 #if !defined (ACE_LACKS_NTOHL)
00041   ACE_Time_Value tv (this->secs_,
00042                      ntohl (this->usecs_));
00043 
00044   this->secs_ = tv.sec ();
00045   this->usecs_ = tv.usec ();
00046   this->type_ = ntohl (this->type_);
00047   this->pid_ = ntohl (this->pid_);
00048   this->length_ = ntohl (this->length_);
00049 #endif /* ACE_LACKS_NTOHL */
00050 }

void ACE_Log_Record::dump ( void   )  const

Dump the state of an object.

Definition at line 106 of file Log_Record.cpp.

References ACE_BEGIN_DUMP, ACE_DEBUG, ACE_END_DUMP, ACE_TEXT, and LM_DEBUG.

00107 {
00108 #if defined (ACE_HAS_DUMP)
00109   // ACE_TRACE ("ACE_Log_Record::dump");
00110 
00111   ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00112   ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("length_ = %d\n"), this->length_));
00113   ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ntype_ = %u\n"), this->type_));
00114   ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ntime_stamp_ = (%:, %d)\n"),
00115               this->secs_, this->usecs_));
00116   ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\npid_ = %u\n"), this->pid_));
00117   ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nmsg_data_ (0x%@) = %s\n"),
00118               this->msg_data_, this->msg_data_));
00119   ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nmsg_data_size_ = %B\n"),
00120               this->msg_data_size_));
00121   ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00122 #endif /* ACE_HAS_DUMP */
00123 }

ACE_INLINE void ACE_Log_Record::encode ( void   ) 

Encode the <Log_Record> for transmission on the network.

Deprecated:
The encode() and decode() metods are deprecated; please use the CDR insertion and extraction operators to properly encode and decode ACE_Log_Record objects.

Definition at line 20 of file Log_Record.inl.

References ACE_TRACE, length_, pid_, type_, and usecs_.

00021 {
00022   ACE_TRACE ("ACE_Log_Record::encode");
00023 #if !defined (ACE_LACKS_HTONL)
00024   this->length_ = htonl (this->length_);
00025   this->type_ = htonl (this->type_);
00026   // Make sure we don't enclose the sec() and usec() fields until
00027   // they've been normalized.
00028   // secs_ is commented out because it can be 64 bits. This method is
00029   // deprecated; use the CDR operations instead.
00030   //  this->secs_ = htonl (this->secs_);
00031   this->usecs_ = htonl (this->usecs_);
00032   this->pid_ = htonl (this->pid_);
00033 #endif /* ACE_LACKS_HTONL */
00034 }

int ACE_Log_Record::format_msg ( const ACE_TCHAR  host_name[],
u_long  verbose_flag,
ACE_TCHAR verbose_msg 
)

Definition at line 215 of file Log_Record.cpp.

References ACE_BIT_ENABLED, ACE_TEXT, ACE_OS::ctime_r(), priority_name(), secs_, ACE_OS::sprintf(), ACE_OS::strcpy(), ACE::timestamp(), ACE_Log_Msg::VERBOSE, and ACE_Log_Msg::VERBOSE_LITE.

Referenced by print().

00218 {
00219   /* 0123456789012345678901234     */
00220   /* Oct 18 14:25:36.000 1989<nul> */
00221   ACE_TCHAR timestamp[26]; // Only used by VERBOSE and VERBOSE_LITE.
00222 
00223   // The sprintf format needs to be different for Windows and POSIX
00224   // in the wide-char case.
00225 #if defined (ACE_WIN32) || !defined (ACE_USES_WCHAR)
00226   const ACE_TCHAR *time_fmt =         ACE_TEXT ("%s.%03ld %s");
00227   const ACE_TCHAR *verbose_fmt =      ACE_TEXT ("%s@%s@%u@%s@%s");
00228   const ACE_TCHAR *verbose_lite_fmt = ACE_TEXT ("%s@%s@%s");
00229 #else
00230   const ACE_TCHAR *time_fmt = ACE_TEXT ("%ls.%03ld %ls");
00231   const ACE_TCHAR *verbose_fmt = ACE_TEXT ("%ls@%ls@%u@%ls@%ls");
00232   const ACE_TCHAR *verbose_lite_fmt = ACE_TEXT ("%ls@%ls@%ls");
00233 #endif
00234 
00235   if (ACE_BIT_ENABLED (verbose_flag,
00236                        ACE_Log_Msg::VERBOSE)
00237       || ACE_BIT_ENABLED (verbose_flag,
00238                           ACE_Log_Msg::VERBOSE_LITE))
00239     {
00240       time_t const now = this->secs_;
00241       ACE_TCHAR ctp[26]; // 26 is a magic number...
00242 
00243       if (ACE_OS::ctime_r (&now, ctp, sizeof ctp) == 0)
00244         return -1;
00245 
00246       /* 01234567890123456789012345 */
00247       /* Wed Oct 18 14:25:36 1989n0 */
00248 
00249       ctp[19] = '\0'; // NUL-terminate after the time.
00250       ctp[24] = '\0'; // NUL-terminate after the date.
00251 
00252       ACE_OS::sprintf (timestamp,
00253                        time_fmt,
00254                        ctp + 4,
00255                        ((long) this->usecs_) / 1000,
00256                        ctp + 20);
00257     }
00258 
00259   if (ACE_BIT_ENABLED (verbose_flag,
00260                        ACE_Log_Msg::VERBOSE))
00261     {
00262       const ACE_TCHAR *lhost_name = ((host_name == 0)
00263                                       ? ACE_TEXT ("<local_host>")
00264                                       : host_name);
00265       ACE_OS::sprintf (verbose_msg,
00266                        verbose_fmt,
00267                        timestamp,
00268                        lhost_name,
00269                        this->pid_,
00270                        ACE_Log_Record::priority_name (ACE_Log_Priority (this->type_)),
00271                        this->msg_data_);
00272     }
00273   else if (ACE_BIT_ENABLED (verbose_flag, ACE_Log_Msg::VERBOSE_LITE))
00274     ACE_OS::sprintf (verbose_msg,
00275                      verbose_lite_fmt,
00276                      timestamp,
00277                      ACE_Log_Record::priority_name (ACE_Log_Priority (this->type_)),
00278                      this->msg_data_);
00279   else
00280     ACE_OS::strcpy (verbose_msg, this->msg_data_);
00281   return 0;
00282 }

ACE_INLINE void ACE_Log_Record::length ( long   ) 

Set the total length of the <Log_Record>, which needs to account for the size of the various data member fields.

Definition at line 74 of file Log_Record.inl.

References ACE_TRACE, and length_.

00075 {
00076   ACE_TRACE ("ACE_Log_Record::length");
00077   this->length_ = static_cast<ACE_UINT32> (l);
00078 }

ACE_INLINE long ACE_Log_Record::length ( void   )  const

Get the total length of the <Log_Record>, which includes the size of the various data member fields.

Definition at line 67 of file Log_Record.inl.

References ACE_TRACE, and length_.

00068 {
00069   ACE_TRACE ("ACE_Log_Record::length");
00070   return (long) this->length_;
00071 }

int ACE_Log_Record::msg_data ( const ACE_TCHAR data  ) 

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 faisl, this method returns -1, else 0.

Definition at line 126 of file Log_Record.cpp.

References ACE_NEW_RETURN, msg_data_, msg_data_size_, round_up(), ACE_OS::strcpy(), and ACE_OS::strlen().

00127 {
00128   // ACE_TRACE ("ACE_Log_Record::msg_data");
00129   size_t const newlen = ACE_OS::strlen (data) + 1;  // Will need room for '\0'
00130   if (newlen > this->msg_data_size_)
00131     {
00132       ACE_TCHAR *new_msg_data = 0;
00133       ACE_NEW_RETURN (new_msg_data, ACE_TCHAR[newlen], -1);
00134       delete [] this->msg_data_;
00135       this->msg_data_ = new_msg_data;
00136       this->msg_data_size_ = newlen;
00137     }
00138   ACE_OS::strcpy (this->msg_data_, data);
00139   this->round_up ();
00140   return 0;
00141 }

ACE_INLINE const ACE_TCHAR * ACE_Log_Record::msg_data ( void   )  const

Get the message data of the <Log_Record>.

Definition at line 110 of file Log_Record.inl.

References ACE_TRACE, and msg_data_.

Referenced by ACE_Log_Msg_UNIX_Syslog::log(), operator<<(), and operator>>().

00111 {
00112   ACE_TRACE ("ACE_Log_Record::msg_data");
00113   return this->msg_data_;
00114 }

ACE_INLINE size_t ACE_Log_Record::msg_data_len ( void   )  const

Get the size of the message data of the <Log_Record>, including a byte for the NUL.

Definition at line 117 of file Log_Record.inl.

References ACE_TRACE, and ACE_OS::strlen().

Referenced by ACE_Log_Msg_IPC::log(), and operator<<().

00118 {
00119   ACE_TRACE ("ACE_Log_Record::msg_data_len");
00120   return ACE_OS::strlen (this->msg_data_) + 1;
00121 }

ACE_Log_Record& ACE_Log_Record::operator= ( const ACE_Log_Record rhs  )  [private]

ACE_INLINE void ACE_Log_Record::pid ( long   ) 

Set the process id of the <Log_Record>.

Definition at line 103 of file Log_Record.inl.

References ACE_TRACE, and pid_.

00104 {
00105   ACE_TRACE ("ACE_Log_Record::pid");
00106   this->pid_ = (ACE_UINT32) p;
00107 }

ACE_INLINE long ACE_Log_Record::pid ( void   )  const

Get the process id of the <Log_Record>.

Definition at line 96 of file Log_Record.inl.

References ACE_TRACE, and pid_.

Referenced by operator<<(), and operator>>().

00097 {
00098   ACE_TRACE ("ACE_Log_Record::pid");
00099   return (long) this->pid_;
00100 }

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 <ostream> iff the corresponding type is enabled.

Definition at line 385 of file Log_Record.cpp.

References ACE_LOG_MSG, ACE_NEW_RETURN, ACE_TEXT_ALWAYS_CHAR, format_msg(), and MAXVERBOSELOGMSGLEN.

00388 {
00389   if (ACE_LOG_MSG->log_priority_enabled (ACE_Log_Priority (this->type_)))
00390     {
00391       ACE_TCHAR* verbose_msg = 0;
00392       ACE_NEW_RETURN (verbose_msg, ACE_TCHAR[MAXVERBOSELOGMSGLEN], -1);
00393 
00394       int const result = this->format_msg (host_name, verbose_flag, verbose_msg);
00395 
00396       if (result == 0)
00397         {
00398           // Since ostream expects only chars, we cannot pass wchar_t's
00399           s << ACE_TEXT_ALWAYS_CHAR (verbose_msg);
00400           s.flush ();
00401         }
00402 
00403       delete [] verbose_msg;
00404 
00405       return result;
00406     }
00407   return 0;
00408 }

int ACE_Log_Record::print ( const ACE_TCHAR  host_name[],
u_long  verbose_flag,
FILE *  fp = stderr 
)

Write the contents of the logging record to the appropriate <FILE> iff the corresponding type is enabled.

Definition at line 285 of file Log_Record.cpp.

References ACE_LOG_MSG, ACE_NEW_RETURN, ACE_TEXT, ACE_OS::fflush(), format_msg(), ACE_OS::fprintf(), MAXVERBOSELOGMSGLEN, and ACE_OS::strlen().

Referenced by ACE_Log_Msg::log().

00288 {
00289   if (ACE_LOG_MSG->log_priority_enabled (ACE_Log_Priority (this->type_)))
00290     {
00291       ACE_TCHAR *verbose_msg = 0;
00292       ACE_NEW_RETURN (verbose_msg, ACE_TCHAR[MAXVERBOSELOGMSGLEN], -1);
00293 
00294       int result = this->format_msg (host_name, verbose_flag, verbose_msg);
00295 
00296       if (result == 0)
00297         {
00298           if (fp != 0)
00299             {
00300               int const verbose_msg_len =
00301                 static_cast<int> (ACE_OS::strlen (verbose_msg));
00302 #if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR)
00303               int const fwrite_result = ACE_OS::fprintf (fp,
00304                                                          ACE_TEXT ("%ls"),
00305                                                          verbose_msg);
00306 #else
00307               int const fwrite_result = ACE_OS::fprintf (fp,
00308                                                          ACE_TEXT ("%s"),
00309                                                          verbose_msg);
00310 #endif
00311               // We should have written everything
00312               if (fwrite_result != verbose_msg_len)
00313                 result = -1;
00314               else
00315                 ACE_OS::fflush (fp);
00316             }
00317         }
00318 
00319       delete [] verbose_msg;
00320 
00321       return result;
00322     }
00323   else
00324     return 0;
00325 }

void ACE_Log_Record::priority ( u_long  num  ) 

Set the priority of the <Log_Record> <type_> (which must be a power of 2, as defined by the enums in <ACE_Log_Priority>).

Definition at line 96 of file Log_Record.cpp.

References ACE_TRACE, and type_.

00097 {
00098   ACE_TRACE ("ACE_Log_Record::priority");
00099 
00100   // Set the priority of the <Log_Record> <type_> (which must be a
00101   // power of 2, as defined by the enums in <ACE_Log_Priority>).
00102   this->type_ = (ACE_UINT32) p;
00103 }

u_long ACE_Log_Record::priority ( void   )  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>).

Definition at line 85 of file Log_Record.cpp.

References ACE_TRACE, and ACE::log2().

00086 {
00087   ACE_TRACE ("ACE_Log_Record::priority");
00088 
00089   // Get the priority of the <Log_Record> <type_>.  This is computed
00090   // as the base 2 logarithm of <type_> (which must be a power of 2,
00091   // as defined by the enums in <ACE_Log_Priority>).
00092   return ACE::log2 ((u_long) this->type_);
00093 }

void ACE_Log_Record::priority_name ( ACE_Log_Priority  p,
const ACE_TCHAR name 
) [static]

Definition at line 77 of file Log_Record.cpp.

References ACE_BEGIN_VERSIONED_NAMESPACE_DECL::ace_priority_names, and ACE::log2().

00079 {
00080   // Name must be a statically allocated string
00081   ace_priority_names[ACE::log2 (p)] = name;
00082 }

const ACE_TCHAR * ACE_Log_Record::priority_name ( ACE_Log_Priority  p  )  [static]

Returns a character array with the string form of the <ACE_Log_Priority> parameter. This is used for the verbose printing format.

Definition at line 71 of file Log_Record.cpp.

References ACE_BEGIN_VERSIONED_NAMESPACE_DECL::ace_priority_names, and ACE::log2().

Referenced by format_msg(), ACE_Log_Msg_UNIX_Syslog::log(), and ACE_Log_Msg::log().

00072 {
00073   return ace_priority_names[ACE::log2 (p)];
00074 }

void ACE_Log_Record::round_up ( void   )  [private]

Round up to the alignment restrictions.

Definition at line 184 of file Log_Record.cpp.

References ALIGN_WORDB, length_, and ACE_OS::strlen().

Referenced by msg_data().

00185 {
00186   // ACE_TRACE ("ACE_Log_Record::round_up");
00187   // Determine the length of the payload.
00188   size_t len = sizeof (*this) + (sizeof (ACE_TCHAR) * ((ACE_OS::strlen (this->msg_data_) + 1)));
00189 
00190   // Round up to the alignment.
00191   len = ((len + ACE_Log_Record::ALIGN_WORDB - 1)
00192          & ~(ACE_Log_Record::ALIGN_WORDB - 1));
00193   this->length_ = static_cast<ACE_UINT32> (len);
00194 }

ACE_INLINE void ACE_Log_Record::time_stamp ( const ACE_Time_Value ts  ) 

Set the time stamp of the <Log_Record>.

Definition at line 88 of file Log_Record.inl.

References ACE_TRACE, ACE_Time_Value::sec(), secs_, ACE_Time_Value::usec(), and usecs_.

00089 {
00090   ACE_TRACE ("ACE_Log_Record::time_stamp");
00091   this->secs_ = ts.sec ();
00092   this->usecs_ = (ACE_UINT32) ts.usec ();
00093 }

ACE_INLINE ACE_Time_Value ACE_Log_Record::time_stamp ( void   )  const

Get the time stamp of the <Log_Record>.

Definition at line 81 of file Log_Record.inl.

References ACE_TRACE.

Referenced by operator<<(), and operator>>().

00082 {
00083   ACE_TRACE ("ACE_Log_Record::time_stamp");
00084   return ACE_Time_Value (this->secs_, (long) this->usecs_);
00085 }

ACE_INLINE void ACE_Log_Record::type ( ACE_UINT32   ) 

Set the type of the <Log_Record>.

Definition at line 60 of file Log_Record.inl.

References ACE_TRACE, and type_.

00061 {
00062   ACE_TRACE ("ACE_Log_Record::type");
00063   this->type_ = t;
00064 }

ACE_INLINE ACE_UINT32 ACE_Log_Record::type ( void   )  const

Get the type of the <Log_Record>.

Definition at line 53 of file Log_Record.inl.

References ACE_TRACE, and type_.

Referenced by ACE_Log_Msg_UNIX_Syslog::log(), operator<<(), and operator>>().

00054 {
00055   ACE_TRACE ("ACE_Log_Record::type");
00056   return this->type_;
00057 }


Member Data Documentation

ACE_Log_Record::ACE_ALLOC_HOOK_DECLARE

Declare the dynamic allocation hooks.

Definition at line 175 of file Log_Record.h.

ACE_INT32 ACE_Log_Record::length_ [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 portably across platforms.

Definition at line 187 of file Log_Record.h.

Referenced by decode(), encode(), length(), and round_up().

ACE_TCHAR* ACE_Log_Record::msg_data_ [private]

Logging record data.

Definition at line 200 of file Log_Record.h.

Referenced by ACE_Log_Record(), msg_data(), and ~ACE_Log_Record().

size_t ACE_Log_Record::msg_data_size_ [private]

Definition at line 201 of file Log_Record.h.

Referenced by ACE_Log_Record(), and msg_data().

ACE_UINT32 ACE_Log_Record::pid_ [private]

Id of process that generated the logging record.

Definition at line 197 of file Log_Record.h.

Referenced by decode(), encode(), and pid().

time_t ACE_Log_Record::secs_ [private]

Time that the logging record was generated.

Definition at line 193 of file Log_Record.h.

Referenced by decode(), format_msg(), and time_stamp().

ACE_UINT32 ACE_Log_Record::type_ [private]

Type of logging record.

Definition at line 190 of file Log_Record.h.

Referenced by decode(), encode(), priority(), and type().

ACE_UINT32 ACE_Log_Record::usecs_ [private]

Definition at line 194 of file Log_Record.h.

Referenced by decode(), encode(), and time_stamp().


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:35:15 2010 for ACE by  doxygen 1.4.7