MODALIZER SDK  3.2.2.2
Diagnostics & Logging.

RZDCX can write diagnostic messages to a log file.Logging is controlled by the IDCXAPP class. The user can start and stop logging, define the log level and limit the log file size. Every log entry starts with timestamp, thread id and error level. Log entries may span over multiple lines in the log file. More...

Enumerations

enum  LOG_LEVEL {
  LOG_LEVEL_NONE = 0 , LOG_LEVEL_FATAL = 1 , LOG_LEVEL_ERROR = 2 , LOG_LEVEL_WARNING = 3 ,
  LOG_LEVEL_INFO = 4 , LOG_LEVEL_DEBUG = 5
}
 

Functions

HRESULT IDCXAPP::StartLogging ([in] BSTR filename)
 Start logging to a file.
 
HRESULT IDCXAPP::StopLogging ()
 Stop logging.
 
HRESULT rzdcxLib::_IDCXAPPEvents::OnMaxLogCount (int count, BSTR closed_file_name, BSTR *new_file_name)
 

Properties

LOG_LEVEL IDCXAPP::LogLevel [get, set]
 Set/Get Log Level.
 
int IDCXAPP::MaxLogMessages [get, set]
 Set/Get maximum number of log messages per log file. More...
 

Detailed Description

RZDCX can write diagnostic messages to a log file.

Logging is controlled by the IDCXAPP class. The user can start and stop logging, define the log level and limit the log file size. Every log entry starts with timestamp, thread id and error level. Log entries may span over multiple lines in the log file.

Enumeration Type Documentation

◆ LOG_LEVEL

enum LOG_LEVEL

Log level for log file messages. Log levels are incremental debug beying the most details and none bying silent.

Enumerator
LOG_LEVEL_NONE 

Do not write log messages of any level.

LOG_LEVEL_FATAL 

Log fatal errors.

LOG_LEVEL_ERROR 

Log errors and fatal errors.

LOG_LEVEL_WARNING 

Log warning, errors and fatal errors.

LOG_LEVEL_INFO 

Log information messages, warnings, errors and fatal errors.

LOG_LEVEL_DEBUG 

Log debug messages, information messages, warnings, errors and fatal errors.

Function Documentation

◆ OnMaxLogCount()

HRESULT rzdcxLib::_IDCXAPPEvents::OnMaxLogCount ( int  count,
BSTR  closed_file_name,
BSTR *  new_file_name 
)

This event is triggered when the maximum number of messages per log file is reached. You should only have one instance of DCXAPP and one callback like this one. If more then one DCXAPP instances exists and more then one callback are registered, then all registered callbacks will be fired at the order of regitration and the new file name will be the last offered. If not provided, then the new file name will be identical to the closed file name which will be overriden. This event lets the user's an oportunity to rename the closed file in order to keep it.

See also
IDCXAPP::MaxLogMessages
Parameters
countThe number of messages in the closed log file
closed_file_nameThe name of the log file that was closed. This file is not locked and can be renamed by the user within this function.
new_file_nameOptional new log file name. If not set, the same name as the closed file will be used.

Properties

◆ MaxLogMessages

int IDCXAPP::MaxLogMessages
getsetproperty

Set/Get maximum number of log messages per log file.

The default is 50000 messages. When the maximum is reached, the following sequence of actions is taken:

The log file is closed.

The OnMaxLogCount event is fired allowing the user to:

  1. rename the closed log file
  2. provide a new name for the new log file

Open a new log file

If the event is not implemented, the default action is to add the suffix ".old" to the closed file and open a new log file with the same name as the old one. The default maximum number of messages is 50000. If not overriden, at the most two log files will be created one with the name provided and one with the ".old" suffix. To disable the log file maximum size feature, set this property to 0 (or negative value).