From version 1.1.0, it is possible to configure Damaris to write internal events to log files. Enabling the logging capability feature is easy. To enable logging, just add the following line of code at the root of your XML file. It should be noted that logging feature in Damaris is based on the Boost Logging Library.
1 2 3 4
<log FileName="log/2dmesh" RotationSize="5" LogFormat="[%TimeStamp%]: %Message%" LogLevel="info" />
The above <Log> tag contains some attributes that are described below:
- FileName: contains the path and the initial part of the log file name. To this string, the process number that produced the log and the file number are added.
- RotationSize (in MegaBytes): Shows how large the log files should be. If the size of a log file exceeds this amount, another log file will be created.
- LogFormat: Shows what should be put on each line of the log file. The mentioned value in the attribute above shows a time stamp (date + time) and the message that is passed from Damaris.
- LogLevel: Shows how deep the messages should be logged. The available values are trace, debug, info, warning, error, fatal.
From version 1.5.0 a Flush attributes has been added :
- Flush: flush the log file to disk on each iteration, otherwise only at the end of the simulation. It has a default of False (do not flush every iteration)
Note: Currently, only the entry points of Damaris API is equipped with logging. If you need more detailed logging in the code, you will need to put your own logs inside the code.