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... | |
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.
enum LOG_LEVEL |
Log level for log file messages. Log levels are incremental debug beying the most details and none bying silent.
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.
count | The number of messages in the closed log file |
closed_file_name | The 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_name | Optional new log file name. If not set, the same name as the closed file will be used. |
|
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:
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).