[libcamera-devel] libcamera: log: Expand log level names

Message ID 20200114012626.25265-1-kieran.bingham@ideasonboard.com
State Superseded
Headers show
Series
  • [libcamera-devel] libcamera: log: Expand log level names
Related show

Commit Message

Kieran Bingham Jan. 14, 2020, 1:26 a.m. UTC
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.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 src/libcamera/log.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Laurent Pinchart Jan. 14, 2020, 1:27 a.m. UTC | #1
Hi Kieran,

Thank you for the patch.

On Tue, Jan 14, 2020 at 01:26:26AM +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.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  src/libcamera/log.cpp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/libcamera/log.cpp b/src/libcamera/log.cpp
> index f4eb8c11adc3..4fc4b5ce0d39 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",
>  	};
>

Patch

diff --git a/src/libcamera/log.cpp b/src/libcamera/log.cpp
index f4eb8c11adc3..4fc4b5ce0d39 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",
 	};