diff mbox series

core: fix verbose mode

Message ID 20230128165110.4196-1-daniel@braunwarth.dev
State Accepted
Headers show
Series core: fix verbose mode | expand

Commit Message

Daniel Braunwarth Jan. 28, 2023, 4:51 p.m. UTC
Using the verbose mode should set the log level to the
highest available log level.

Signed-off-by: Daniel Braunwarth <daniel@braunwarth.dev>
Co-developed-by: Daniel Braunwarth <daniel.braunwarth@kuka.com>
Signed-off-by: Daniel Braunwarth <daniel.braunwarth@kuka.com>
---
 core/swupdate.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Stefano Babic Feb. 5, 2023, 10:05 a.m. UTC | #1
Hi Daniel,

On 28.01.23 17:51, Daniel Braunwarth wrote:
> Using the verbose mode should set the log level to the
> highest available log level.
> 
> Signed-off-by: Daniel Braunwarth <daniel@braunwarth.dev>
> Co-developed-by: Daniel Braunwarth <daniel.braunwarth@kuka.com>
> Signed-off-by: Daniel Braunwarth <daniel.braunwarth@kuka.com>
> ---
>   core/swupdate.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/core/swupdate.c b/core/swupdate.c
> index 34c9e34..9955b4b 100644
> --- a/core/swupdate.c
> +++ b/core/swupdate.c
> @@ -506,7 +506,7 @@ int main(int argc, char **argv)
>   			loglevel = strtoul(optarg, NULL, 10);
>   			break;
>   		case 'v':
> -			loglevel = TRACELEVEL;
> +			loglevel = LASTLOGLEVEL;
>   			break;
>   		case '0':
>   			printf("%s", BANNER);
> @@ -548,7 +548,7 @@ int main(int argc, char **argv)
>   			exit(EXIT_FAILURE);
>   		}
>   
> -		loglevel = swcfg.verbose ? TRACELEVEL : swcfg.loglevel;
> +		loglevel = swcfg.verbose ? LASTLOGLEVEL : swcfg.loglevel;
>   
>   		/*
>   		 * The following sections are optional, hence -ENODATA error code is
> @@ -579,7 +579,7 @@ int main(int argc, char **argv)
>   		}
>   		switch (c) {
>   		case 'v':
> -			loglevel = TRACELEVEL;
> +			loglevel = LASTLOGLEVEL;
>   			break;
>   #ifdef CONFIG_UBIATTACH
>   		case 'b':

Applied to -master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/core/swupdate.c b/core/swupdate.c
index 34c9e34..9955b4b 100644
--- a/core/swupdate.c
+++ b/core/swupdate.c
@@ -506,7 +506,7 @@  int main(int argc, char **argv)
 			loglevel = strtoul(optarg, NULL, 10);
 			break;
 		case 'v':
-			loglevel = TRACELEVEL;
+			loglevel = LASTLOGLEVEL;
 			break;
 		case '0':
 			printf("%s", BANNER);
@@ -548,7 +548,7 @@  int main(int argc, char **argv)
 			exit(EXIT_FAILURE);
 		}
 
-		loglevel = swcfg.verbose ? TRACELEVEL : swcfg.loglevel;
+		loglevel = swcfg.verbose ? LASTLOGLEVEL : swcfg.loglevel;
 
 		/*
 		 * The following sections are optional, hence -ENODATA error code is
@@ -579,7 +579,7 @@  int main(int argc, char **argv)
 		}
 		switch (c) {
 		case 'v':
-			loglevel = TRACELEVEL;
+			loglevel = LASTLOGLEVEL;
 			break;
 #ifdef CONFIG_UBIATTACH
 		case 'b':