The EC-Monitor offers a logging interface for a more detailed analysis of application errors, problems in the EtherCAT network and for diagnosing internal processes.
The log messages are passed from the EC-Monitor to the application via the callback
EC_T_LOG_PARMS::pfLogMsg given at
typedef EC_T_DWORD (*EC_PF_LOGMSGHK)(struct _EC_T_LOG_CONTEXT *pContext, EC_T_DWORD dwLogMsgSeverity, const EC_T_CHAR *szFormat, ...)
The level of detail of the logging output can be set via
EC_T_LOG_PARMS::dwLogLevel. The log levels are firmly defined:
For performance reasons, the log messages are automatically filtered based on the log level and then passed to the callback.
EcMonitorDemo examples demonstrate how log messages can be processed by the application, see
The messages processed by
EcLogging.cpp are of different types, e.g. EC-Monitor log messages and application messages are logged to the console and/or files.
Identical messages are skipped automatically by default.
With some operating systems, logging in files is deactivated, e.g. because a file system is not available.
The verbosity of the
EcMonitorDemo is specified as a
-v command line parameter. It is used to determine the log level of the application, see
EcLogging.cpp has various parameters beside the log level, like Roll Over setting, log task priority, CPU affinity, log buffer size and etc.