---
name: "ACE_Log_Record"
section: "3"
platform: "linux"
package: "libace-doc"
version: "5.0.7-4"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/ACE_Log_Record"
---

# ACE\_Log\_Record(3)

## 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
