ApparatusFramework::DoubleDeviceLogger Class Reference
[Diagnostic Services]

#include <DiagnosticServices/current/include/DoubleDeviceLogger.h>

Inheritance diagram for ApparatusFramework::DoubleDeviceLogger:
ApparatusFramework::Logger ApparatusFramework::Monitor

List of all members.

Public Member Functions

void printLogText (LogLevel logLevel, const char *aFormat,...)
void decompressAndPrintLogText_SimpleCoding (LogLevel logLevel, const unsigned char *form_spec,...)
void setLogLevelSeparation (LogLevel logLevel)
void setLogDevice (LogDevice logDevice, const char *logDeviceName="tty0")
void printTimestamp (bool active)

Static Public Member Functions

static DoubleDeviceLoggerCreate ()
static DoubleDeviceLoggerDefault ()
static bool IsCreated ()

Detailed Description

The logger class provides basic logging mechanisms to trace activities of the apparatus framework and the user application. Logging is supported in the simulation environment (application running on the developer workstation) and on the embedded target.

The class is implemented as a monitor to be thread safe. As a side effect the events are logged in chronological order. All public methods are protected by the monitor mechanisms.

A filter mechanism allows selectively reducing the number of logged events at runtime.

Definition at line 126 of file DoubleDeviceLogger.h.


Member Function Documentation

static DoubleDeviceLogger* ApparatusFramework::DoubleDeviceLogger::Create (  )  [static]

static functions Creates an instance of the singleton if none exists yet. The object is created in static memory.

Returns:
A pointer to the created singleton instance.

Reimplemented from ApparatusFramework::Logger.

void ApparatusFramework::DoubleDeviceLogger::decompressAndPrintLogText_SimpleCoding ( LogLevel  logLevel,
const unsigned char *  form_spec,
  ... 
)

Prints out text that is compressed with "Simple Coding" to the log device, regardless of any filter or enabling/disabling.

Parameters:
form_spec printf like string that supports formatting but the string must be compressed with "Simple Coding". The syntax for the formatted string is like printf with the extension for compressed string arguments: Use cs for compressed string arguments!
... printf like parameter list that supports formatting of the string. Argument list: Compressed string parameter or standard parameters like printf.
static DoubleDeviceLogger* ApparatusFramework::DoubleDeviceLogger::Default (  )  [static]

Returns the registered singleton instance.

Returns:
The registered logger instance. If none is registered null is returned.

Reimplemented from ApparatusFramework::Logger.

static bool ApparatusFramework::DoubleDeviceLogger::IsCreated (  )  [static]

States whether an instance of this singleton has been created.

Returns:
True if an instance has been created, false otherwise.

Reimplemented from ApparatusFramework::Logger.

void ApparatusFramework::DoubleDeviceLogger::printLogText ( LogLevel  logLevel,
const char *  aFormat,
  ... 
)

modifiers Prints out text to the log device, regardless of any filter or enabling/disabling. As long as there is no log device set, vprintf is used directly.

Parameters:
aFormat printf like string that supports formatting.
... printf like parameter list that supports formatting of the string.
void ApparatusFramework::DoubleDeviceLogger::printTimestamp ( bool  active  ) 

Sets the CharDevice the logged messages are sent to. Please make sure that the specified device is registered with the DeviceMgr before calling this method.

Parameters:
logDeviceName name of the CharDevice, "tty0" by default.
Note:
This method is only available if the DeviceServices package is added to the ApparatusFramework library.
void ApparatusFramework::DoubleDeviceLogger::setLogDevice ( LogDevice  logDevice,
const char *  logDeviceName = "tty0" 
)

Sets the CharDevice the logged messages are sent to. Please make sure that the specified device is registered with the DeviceMgr before calling this method.

Parameters:
logDeviceName name of the CharDevice, "tty0" by default.
Note:
This method is only available if the DeviceServices package is added to the ApparatusFramework library.
void ApparatusFramework::DoubleDeviceLogger::setLogLevelSeparation ( LogLevel  logLevel  ) 

Prints out text that is compressed with "Huffman Coding" to the log device, regardless of any filter or enabling/disabling.

Parameters:
form_spec printf like string that supports formatting but the string must be compressed with "Huffman Coding". The syntax for the formatted string is like printf with the extension for compressed string arguments: Use cs for compressed string arguments!
... printf like parameter list that supports formatting of the string. Argument list: Compressed string parameter or standard parameters like printf. Sets the CharDevice the logged messages are sent to. Please make sure that the specified device is registered with the DeviceMgr before calling this method.
logDeviceName name of the CharDevice, "tty0" by default.
Note:
This method is only available if the DeviceServices package is added to the ApparatusFramework library.
© 2004-2010 bbv Software Services AG / Apparatus Services