logger: support logging local timestamps and other timestamp logs

In timestamps, support different clocks and local time as formats.

Local real time timestamps are useful when trying to correlate logs from
different sources.
This commit is contained in:
Pauli Virtanen 2024-12-14 13:30:44 +02:00 committed by Wim Taymans
parent 13c869801c
commit 1ec814977c
2 changed files with 32 additions and 6 deletions

View file

@ -379,7 +379,8 @@ SPA_API_LOG void spa_log_logtv(struct spa_log *l, enum spa_log_level level,
* colors even when not logging to a terminal */
#define SPA_KEY_LOG_FILE "log.file" /**< log to the specified file instead of
* stderr. */
#define SPA_KEY_LOG_TIMESTAMP "log.timestamp" /**< log timestamps */
#define SPA_KEY_LOG_TIMESTAMP "log.timestamp" /**< log timestamp type (local, realtime, monotonic, monotonic-raw).
* boolean true means local. */
#define SPA_KEY_LOG_LINE "log.line" /**< log file and line numbers */
#define SPA_KEY_LOG_PATTERNS "log.patterns" /**< Spa:String:JSON array of [ {"pattern" : level}, ... ] */