XFcLogger class Reference

Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members

# XFcLogger Class Reference

Data logger class. More...

List of all members.

## Public Types

enum

XFCLOGFLAGS {
XFCLOG_INFO = 1,
XFCLOG_DATA = 2,
XFCLOG_FLOW = 4,
XFCLOG_ERR = 8,
XFCLOG_WARN = 16,
XFCLOG_CRIT = 32,
XFCLOG_INDENT = 64,
XFCLOG_UNDENT = 128,
XFCLOG_ALL = 0xffffffff
}

| XFCLOGFLAGS can be used to mask out specific types of logging. More...

## Public Member Functions

XFCIMPORT | ~XFcLogger ()
| Destructor.

## Static Public Member Functions

XFCIMPORT XFcLogger * | create ()
| Static constructor.
XFCIMPORT void | log (const CHAR *aTxt, XFCLOGFLAGS aFlag)
| Logs a string, with a specific log entry type.
XFCIMPORT void | log (const CHAR8 *aTxt, INT32 aLength, XFCLOGFLAGS aFlag)
| Logs a data buffer as hex string values, with a specific log entry type.
XFCIMPORT void | setMask (UINT32 aMask)
| Sets logging mask.
XFCIMPORT UINT32 | getMask ()
| Returns current logging mask.
XFCIMPORT void | setFileSizeLimit (UINT32 aSizeLimit)
| Sets the maximum size of the log file.
XFCIMPORT UINT32 | getFileSizeLimit ()
| Returns the maximum size of the log file, in bytes.
XFCIMPORT void | indent ()
| Indents log entries.
XFCIMPORT void | undent ()
| Undents log entries.
XFCIMPORT void | setLogLevel (INT aLevel)
| Sets current log level for program flow.
XFCIMPORT INT | getLogLevel ()
| Returns current log level for program flow.

## Protected Member Functions

UINT32 | findThreadNum ()
| Finds the number of the current thread.
CHAR * | createFileName (UINT32 aThreadId)
| Creates and returns a filename for a specific thread.
void | writeTypeInfo (XFCLOGFLAGS aFlag, XFcFile *aFile)
| Writes the type header with the given flag.
void | doLog (const CHAR *aTxt, XFCLOGFLAGS aFlag)
| Does the real logging.
void | doLog (const CHAR8 *aTxt, INT32 aLength, XFCLOGFLAGS aFlag)
| Does the real logging.
void | doSetMask (UINT32 aMask)
| Does the real set mask.
UINT32 | doGetMask ()
| Does the real get mask.
void | doSetFileSizeLimit (UINT32 aSizeLimit)
| Does the real setFileSizeLimit.
UINT32 | doGetFileSizeLimit ()
| Does the real getFileSizeLimit.
void | doIndent ()
| Does the real indent.
void | doUndent ()
| Does the real undent.
void | doSetLogLevel (INT aLevel)
| Does the real setLogLevel.
INT | doGetLogLevel ()
| Does the real getLogLevel.

## Protected Attributes

INT | mNumThreads
| Number of threads.
UINT32 | mThreadIds [MAX_NUM_LOGTHREADS]
| Thread ids.
INT | mCurrentIndent [MAX_NUM_LOGTHREADS]
| The current indentation level.
INT32 | mFileSizeLimit [MAX_NUM_LOGTHREADS]
| The current file size limit, default is -1 which means no limit.
UINT32 | mLogFlags [MAX_NUM_LOGTHREADS]
| The current log flags (mask).
INT | mLoggingStarted [MAX_NUM_LOGTHREADS]
| Is logging started.
INT | mFileSizeLimitExceeded [MAX_NUM_LOGTHREADS]
| Is file size exceeded.
INT | mLogLevel [MAX_NUM_LOGTHREADS]
| The current logging level for program flow.

## Detailed Description

Data logger class.

:

## Member Enumeration Documentation

enum XFcLogger::XFCLOGFLAGS

XFCLOGFLAGS can be used to mask out specific types of logging.

Enumeration values:

  XFCLOG_INFO | Log general information.
  XFCLOG_DATA | Log general data.
  XFCLOG_FLOW | Log program flow information.
  XFCLOG_ERR | Log an error.
  XFCLOG_WARN | Log a warning.
  XFCLOG_CRIT | Log a critical error.
  XFCLOG_INDENT | Log indents.
  XFCLOG_UNDENT | Log undents.
  XFCLOG_ALL | Log everything.

## Constructor & Destructor Documentation

XFCIMPORT XFcLogger::~XFcLogger | ( |  | ) |

| Destructor.

## Member Function Documentation

XFCIMPORT XFcLogger* XFcLogger::create | ( |  | ) | `[static]`

| Static constructor.

CHAR* XFcLogger::createFileName | ( | UINT32 | aThreadId | ) | `[protected]`

Creates and returns a filename for a specific thread.

Parameters:

  aThreadId | thread id to create the filename for.

UINT32 XFcLogger::doGetFileSizeLimit | ( |  | ) | `[protected]`

| Does the real getFileSizeLimit.

INT XFcLogger::doGetLogLevel | ( |  | ) | `[protected]`

| Does the real getLogLevel.

UINT32 XFcLogger::doGetMask | ( |  | ) | `[protected]`

| Does the real get mask.

void XFcLogger::doIndent | ( |  | ) | `[protected]`

| Does the real indent.

void XFcLogger::doLog | ( | const CHAR8 * | aTxt,
|  | INT32 | aLength,
|  | XFCLOGFLAGS | aFlag
| ) | `[protected]`

| Does the real logging.

void XFcLogger::doLog | ( | const CHAR * | aTxt,
|  | XFCLOGFLAGS | aFlag
| ) | `[protected]`

| Does the real logging.

void XFcLogger::doSetFileSizeLimit | ( | UINT32 | aSizeLimit | ) | `[protected]`

| Does the real setFileSizeLimit.

void XFcLogger::doSetLogLevel | ( | INT | aLevel | ) | `[protected]`

| Does the real setLogLevel.

void XFcLogger::doSetMask | ( | UINT32 | aMask | ) | `[protected]`

| Does the real set mask.

void XFcLogger::doUndent | ( |  | ) | `[protected]`

| Does the real undent.

UINT32 XFcLogger::findThreadNum | ( |  | ) | `[protected]`

| Finds the number of the current thread.

XFCIMPORT UINT32 XFcLogger::getFileSizeLimit | ( |  | ) | `[static]`

| Returns the maximum size of the log file, in bytes.

XFCIMPORT INT XFcLogger::getLogLevel | ( |  | ) | `[static]`

| Returns current log level for program flow.

XFCIMPORT UINT32 XFcLogger::getMask | ( |  | ) | `[static]`

| Returns current logging mask.

XFCIMPORT void XFcLogger::indent | ( |  | ) | `[static]`

| Indents log entries.

XFCIMPORT void XFcLogger::log | ( | const CHAR8 * | aTxt,
|  | INT32 | aLength,
|  | XFCLOGFLAGS | aFlag
| ) | `[static]`

Logs a data buffer as hex string values, with a specific log entry type.

Parameters:

  aTxt | data buffer to log.
  aLength | length of the data buffer.
  aFlag | type of log entry.

XFCIMPORT void XFcLogger::log | ( | const CHAR * | aTxt,
|  | XFCLOGFLAGS | aFlag
| ) | `[static]`

Logs a string, with a specific log entry type.

Parameters:

  aTxt | string to log.
  aFlag | type of log entry.

XFCIMPORT void XFcLogger::setFileSizeLimit | ( | UINT32 | aSizeLimit | ) | `[static]`

Sets the maximum size of the log file.

Parameters:

  aSizeLimit | new maximum size for the log, in bytes.

XFCIMPORT void XFcLogger::setLogLevel | ( | INT | aLevel | ) | `[static]`

| Sets current log level for program flow.

XFCIMPORT void XFcLogger::setMask | ( | UINT32 | aMask | ) | `[static]`

Sets logging mask.

Parameters:

  aMask | disabled logging types, see XFCLOGFLAGS.

See also:
  XFCLOGFLAGS

XFCIMPORT void XFcLogger::undent | ( |  | ) | `[static]`

| Undents log entries.

void XFcLogger::writeTypeInfo | ( | XFCLOGFLAGS | aFlag,
|  | XFcFile * | aFile
| ) | `[protected]`

Writes the type header with the given flag.

Parameters:

  aFlag | log entry type.
  aFile | file to write in.

## Member Data Documentation

INT XFcLogger::mCurrentIndent[MAX_NUM_LOGTHREADS]`[protected]`

| The current indentation level.

INT32 XFcLogger::mFileSizeLimit[MAX_NUM_LOGTHREADS]`[protected]`

| The current file size limit, default is -1 which means no limit.

INT XFcLogger::mFileSizeLimitExceeded[MAX_NUM_LOGTHREADS]`[protected]`

| Is file size exceeded.

UINT32 XFcLogger::mLogFlags[MAX_NUM_LOGTHREADS]`[protected]`

| The current log flags (mask).

INT XFcLogger::mLoggingStarted[MAX_NUM_LOGTHREADS]`[protected]`

| Is logging started.

INT XFcLogger::mLogLevel[MAX_NUM_LOGTHREADS]`[protected]`

| The current logging level for program flow.

INT XFcLogger::mNumThreads`[protected]`

| Number of threads.

UINT32 XFcLogger::mThreadIds[MAX_NUM_LOGTHREADS]`[protected]`

| Thread ids.

|  | X-Forge Documentation Confidential Copyright © 2002-2003 Fathammer |  | Documentation generated with doxygen by Dimitri van Heesch