Message ID | 20200114014728.29981-1-kieran.bingham@ideasonboard.com |
---|---|
State | Superseded |
Headers | show |
Series |
|
Related | show |
Hi Kieran, Thanks for your work. On 2020-01-14 01:47:28 +0000, Kieran Bingham wrote: > 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> > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> > --- > v2: > - Expand commit message > - Expand spacing before the log severity name is printed. > > src/libcamera/log.cpp | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/src/libcamera/log.cpp b/src/libcamera/log.cpp > index f4eb8c11adc3..7d59f411f5d7 100644 > --- a/src/libcamera/log.cpp > +++ b/src/libcamera/log.cpp > @@ -83,10 +83,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", > }; > > @@ -196,7 +196,7 @@ void LogOutput::write(const LogMessage &msg) > break; > case LoggingTargetStream: > case LoggingTargetFile: > - str = "[" + utils::time_point_to_string(msg.timestamp()) + "]" > + str = "[" + utils::time_point_to_string(msg.timestamp()) + "] " > + log_severity_name(msg.severity()) + " " > + msg.category().name() + " " + msg.fileInfo() + " " > + msg.msg(); > -- > 2.20.1 > > _______________________________________________ > libcamera-devel mailing list > libcamera-devel@lists.libcamera.org > https://lists.libcamera.org/listinfo/libcamera-devel
diff --git a/src/libcamera/log.cpp b/src/libcamera/log.cpp index f4eb8c11adc3..7d59f411f5d7 100644 --- a/src/libcamera/log.cpp +++ b/src/libcamera/log.cpp @@ -83,10 +83,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", }; @@ -196,7 +196,7 @@ void LogOutput::write(const LogMessage &msg) break; case LoggingTargetStream: case LoggingTargetFile: - str = "[" + utils::time_point_to_string(msg.timestamp()) + "]" + str = "[" + utils::time_point_to_string(msg.timestamp()) + "] " + log_severity_name(msg.severity()) + " " + msg.category().name() + " " + msg.fileInfo() + " " + msg.msg();