1 # Logging system{#logging}
5 By default, i.e. if no error occours when loading the CAEN libraries, the output is written
6 in a file named CAENMCALog.txt, that is created in the current directory.
7 In case of error, the file name could be different.
9 To change the default file, you may set the environmental variable
11 CAEN_LOG_FILENAME = <filename>
13 to force the output to a file of your choice.
14 If you want the output to be printed in the
15 standard output, use the special files of your system:
17 CAEN_LOG_FILENAME = /dev/stdout # Linux
18 CAEN_LOG_FILENAME = CON # Windows
22 The log supports 5 levels:
23 * level **0**: `OFF` (intended to turn off logging)
24 * level **1**: `ERROR`
25 * level **2**: `WARNING`
27 * level **4**: `DEBUG`
29 By default, all the levels are printed. To change the default file, you may set the environmental variable
31 CAEN_LOG_LEVEL = <level number>
34 to set the level to **M**. A log request of level **N** in a logger
35 with level set to **N** will be enabled if **N <= M**.
38 The log will consist of lines in the form
41 [<seconds since start (12 chars, 3 decimal)>][<severity (2 chars)>][<source file>]: <Message>
44 Wher the severity is `EE` for `ERROR`, `WW` for `WARNING`, and so on.
45 For example, these should be the beginning of log with successful connection to a device.
48 [ 0.303][II][CAENMCA.c]: Socket created.
49 [ 0.304][II][CAENMCA.c]: Connected to 'localhost:56342'.