The logging function provides a fine grained control mechanism to specify what is logged for which interface. For example, there could be a full log running on CAN line 0, while API accesses were recorded on CAN line 3 and only errors for all other lines.
To allow this, the items LogLevel and LogPath can be set individually for each line or globally at system level. The system level also configures the logging for non-line errors and events. Example:
iseg_setItem(handle, "LogLevel", "1"); // Log errors on all lines iset_setItem(handle, "0.LogLevel", "255"); // Log everything on line 0 iset_setItem(handle, "3.Loglevel, "12"); // Log API read/write on line 3Note If the system log level is now written again, all line log levels will be overwritten with the new value.
Within the same log paths, a common log file is written. A new log file will be created if the using one would exceed an upper limit of 10 MB. Maximum 10 logfiles are saved per LogPath, older files are deleted.
The items LogLevel and LogPath configure the logging function.
The enumeration IsegLogLevel has the following values. These values can be ORed together.
For example, the default value 3 is LogErrors OR LogInformation.
Name | Value | Description |
---|---|---|
LogErrors | 1 | Log CAN bus error messages, loss of communication, etc. |
LogInformation | 2 | Log state of initialising, switch on/off live insertion mode |
LogApiRead | 4 | Log API read accesses |
LogApiWrite | 8 | Log API write accesses |
LogHvCanReceive | 32 | Log CAN receive messages (HV_CANRX) |
LogHvCanReadRequest | 64 | Log CAN read requests messages (HV_CANRQ) |
LogHvCanWriteRequest | 128 | Log CAN write request messages (HV_CANTX) |
LogLvCanReceive | 256 | Log CAN receive messages (LV_CANRX) |
LogLvCanReadRequest | 512 | Log CAN read request messages (LV_CANRQ) |
LogLvCanWriteRequest | 1024 | Log CAN write request messages (LV_CANTX) |
LogScpiReceive | 2048 | Log SCPI receive messages (RX) |
LogScpiReadRequest | 4096 | Log SCPI read request messages (RQ) |
LogScpiWriteRequest | 8192 | Log SCPI write request messages (TX) |
The values specified in iCSconfig.xml are loaded at the start of isegHAL. They can be overwritten at runtime with the LogLevel and LogPath items. The iCSconfig.xml can be changed by manual editing or by using iCSconfig > isegHAL.
Note Values that were not set in the configuration file are taken from the next higher node, if available or set to default values.
Example snippet of the isegHAL logger configuration in iCSconfig.xml:
Example file /tmp/iseghal_00.log
Note The LOGLEVEL, CANID, DATAID and DATA fields are in hexadecimal.
DATE TIME LOGLEVEL CANID [ DATAID DATA... ] PACKET NUMBER EXPECTET ANSWERS ------------------------------------------------------------------------------------------------------------- 2020-04-01 13:02:34.6588 40 CANRQ 0201 [ 6102 00 0F 00 ] number = 134667736 expected answers = 4 2020-04-01 13:02:34.6599 20 CANRX 0204 [ 6102 00 43 07 CA BD ] number = 474030276 expected answers = 4 2020-04-01 13:02:34.6604 20 CANRX 0204 [ 6102 01 42 F6 00 8D ] number = 474030277 expected answers = 3 2020-04-01 13:02:34.6608 20 CANRX 0204 [ 6102 02 3C 92 9E C0 ] number = 474030278 expected answers = 2 2020-04-01 13:02:34.6613 20 CANRX 0204 [ 6102 03 BD 25 41 A0 ] number = 474030279 expected answers = 1