diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-02-03 19:17:46 +0100 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-06-06 15:09:49 +0300 |
commit | 6132521b47571d143ddb72da09c5b9896ee41925 (patch) | |
tree | 9821c3cb5ca74d95c9ab8d51ec9c85fac16a87b1 /include | |
parent | 575703894624306950c0540182afc48ba3732f8c (diff) |
libcamera: base: log: Color the log prefix
Add coloring to the log prefix to increase log readability.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/libcamera/base/log.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/libcamera/base/log.h b/include/libcamera/base/log.h index 3f065267..3fc5ced3 100644 --- a/include/libcamera/base/log.h +++ b/include/libcamera/base/log.h @@ -57,7 +57,8 @@ class LogMessage { public: LogMessage(const char *fileName, unsigned int line, - const LogCategory &category, LogSeverity severity); + const LogCategory &category, LogSeverity severity, + const std::string &prefix = std::string()); LogMessage(LogMessage &&); ~LogMessage(); @@ -68,6 +69,7 @@ public: LogSeverity severity() const { return severity_; } const LogCategory &category() const { return category_; } const std::string &fileInfo() const { return fileInfo_; } + const std::string &prefix() const { return prefix_; } const std::string msg() const { return msgStream_.str(); } private: @@ -80,6 +82,7 @@ private: LogSeverity severity_; utils::time_point timestamp_; std::string fileInfo_; + std::string prefix_; }; class Loggable |