## NAME

ACE_Log_Record

## SYNOPSIS

    #include <ace/Log_Record.h>

    class ACE_Log_Record
    {
      public:
            enum{ MAXLOGMSGLEN = ACE_MAXLOGMSGLEN,
            ALIGN_WORDB = 8,
            VERBOSE_LEN = 128,
            MAXVERBOSELOGMSGLEN = VERBOSE_LEN + MAXLOGMSGLEN };

        ACE_Log_Record (void);
        ACE_Log_Record (ACE_Log_Priority lp, long time_stamp, long pid);
        ACE_Log_Record (
            ACE_Log_Priority lp,
            const ACE_Time_Value &time_stamp,
            long pid
            );
        ~ACE_Log_Record (void);
        int print (
            const ASYS_TCHAR host_name[],
            u_long verbose_flag,
            FILE *fp = stderr
            );
        FILE *fp);
        int print (
            const ASYS_TCHAR host_name[],
            u_long verbose_flag,
            ostream &stream
            );
        int format_msg (
            const ASYS_TCHAR host_name[],
            u_long verbose_flag,
            ASYS_TCHAR *verbose_msg
            );
        int print (
            const ASYS_TCHAR host_name[],
            u_long verbose_flag,
            ACE_CE_Bridge *log_ = 0
            );
        static const ASYS_TCHAR *priority_name (ACE_Log_Priority p);
        void encode (void);
        void decode (void);
        long type (void) const;
        void type (long);
        u_long priority (void) const;
        void priority (u_long num);
        long length (void) const;
        void length (long);
        const ACE_Time_Value &time_stamp (void) const;
        void time_stamp (const ACE_Time_Value &);
        long pid (void) const;
        void pid (long);
        ASYS_TCHAR *msg_data (void);
        void msg_data (const ASYS_TCHAR *data);
        void msg_data_len (size_t len);
        void dump (void) const;
        ACE_ALLOC_HOOK_DECLARE;
      private:
        void round_up (void);
        ACE_INT32 length_;
        long type_;
        ACE_Time_Value time_stamp_;
        long pid_;
        ASYS_TCHAR msg_data_[MAXLOGMSGLEN];
        static const ASYS_TCHAR *priority_names_[];
    };

## TITLE

Defines the structure of an ACE logging record.

## Initialization

    ACE_Log_Record (void);

    ACE_Log_Record (ACE_Log_Priority lp, long time_stamp, long pid);

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

    ACE_Log_Record (
        ACE_Log_Priority lp,
        const ACE_Time_Value &time_stamp,
        long pid
        );

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

    ~ACE_Log_Record (void);

Default dtor.

    int print (
        const ASYS_TCHAR host_name[],
        u_long verbose_flag,
        FILE *fp = stderr
        );

    FILE *fp);

Write the contents of the logging record to the appropriate `FILE`.

    int print (
        const ASYS_TCHAR host_name[],
        u_long verbose_flag,
        ostream &stream
        );

Write the contents of the logging record to the appropriate `ostream`.

    int format_msg (
        const ASYS_TCHAR host_name[],
        u_long verbose_flag,
        ASYS_TCHAR *verbose_msg
        );

    int print (
        const ASYS_TCHAR host_name[],
        u_long verbose_flag,
        ACE_CE_Bridge *log_ = 0
        );

For Windows CE, the default is to log messages to a preset window.

    static const ASYS_TCHAR *priority_name (ACE_Log_Priority p);

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

## Marshall/demarshall

    void encode (void);

Encode the `Log_Record` for transmission on the network.

    void decode (void);

Decode the `Log_Record` received from the network.

## Set/get methods

    long type (void) const;

Get the type of the `Log_Record`.

    void type (long);

Set the type of the `Log_Record`.

    u_long 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`).

    void 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`).

    long length (void) const;

Get the length of the `Log_Record`.

    void length (long);

Set the length of the `Log_Record`.

    const ACE_Time_Value &time_stamp (void) const;

Get the time stamp of the `Log_Record`.

    void time_stamp (const ACE_Time_Value &);

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`.

    ASYS_TCHAR *msg_data (void);

Get the message data of the `Log_Record`.

    void msg_data (const ASYS_TCHAR *data);

Set the message data of the `Log_Record`.

    void msg_data_len (size_t len);

Set the size of the message data of the `Log_Record`.

    void dump (void) const;

Dump the state of an object.

    ACE_ALLOC_HOOK_DECLARE;

Declare the dynamic allocation hooks.

## AUTHOR

Doug Schmidt

## LIBRARY

ace