Due to losing bytes the logger has a worker which is responsible for dumping logs to the file. The logger also has its own timer to dump logs every 15 minutes. EventManager is not responsible for interval dumping logs now.
1.4 KiB
Logging engine
Logger
Logger class is used for sending log messages coming from LOG macros:
LOG_PRINTFLOG_TRACELOG_DEBUGLOG_INFOLOG_WARNLOG_ERRORLOG_FATALLOG_CUSTOM
to a proper device (SEGGER_RTT, console output, SYSTEMVIEW)
and at the same time to put them to a circular buffer.
Circular buffer has a limited size which sometimes results in losing some logs.
In such a case, proper lost message info is added to msg received from the buffer.
However, it should not happen because the logger has a worker and 2 logger buffers. When the buffer is full the logger switch buffer and sends message to the worker to dump logs.
Dumping to a file
Logs from Circular buffer are dumped to a file named MuditaOS.log when:
Circular bufferis full- every 15 minutes from last dump
- download diagnostic from the phone
- system shutdown
Current max log file size is 15MB. After reaching this size the Rotator save file and add
extension at the end of file extension eg. MuditaOS.log.1. Then create the new file.
Logs can be accessed using mount_user_lfs_partition.py script from tools directory.
Additionally, test/get_os_log.py script allows getting a log file from a running phone.
System logs
There are a series of useful system logging capabilities defined in:
module-utils/log/api/log/debug.hpp