mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-24 17:15:07 +03:00
libcamera: log: Expand log level names
When the log severity names were added, there was only 4 characters reserved for their printing. When the FATAL level was added, this increased to 5, and thus both DBG and ERR can be expanded to their full spelling. This also brings the levels in line with the representation that can be used when calling logSetLevel(). Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
4b44f61c53
commit
1a6d0f5e9a
1 changed files with 3 additions and 3 deletions
|
@ -84,10 +84,10 @@ static int log_severity_to_syslog(LogSeverity severity)
|
|||
static const char *log_severity_name(LogSeverity severity)
|
||||
{
|
||||
static const char *const names[] = {
|
||||
" DBG",
|
||||
"DEBUG",
|
||||
" INFO",
|
||||
" WARN",
|
||||
" ERR",
|
||||
"ERROR",
|
||||
"FATAL",
|
||||
};
|
||||
|
||||
|
@ -198,7 +198,7 @@ void LogOutput::write(const LogMessage &msg)
|
|||
case LoggingTargetStream:
|
||||
case LoggingTargetFile:
|
||||
str = "[" + utils::time_point_to_string(msg.timestamp()) + "] ["
|
||||
+ std::to_string(Thread::currentId()) + "]"
|
||||
+ std::to_string(Thread::currentId()) + "] "
|
||||
+ log_severity_name(msg.severity()) + " "
|
||||
+ msg.category().name() + " " + msg.fileInfo() + " "
|
||||
+ msg.msg();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue