erofs-utils: Print configuration only at INFO debug level
PATCH 1/1 erofs-utils: Print configuration only at INFO debug level
The information printed by erofs_show_config is not useful for ordinary users of the program, and it certainly doesn't count as a warning, so let's only print it at the INFO debug level or greater.
--- lib/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/config.c +1 -1
@@ -34,7 +34,7 @@ void erofs_show_config(void) {const struct erofs_configure *c = &cfg; -if (c->c_dbg_lvl <EROFS_WARN ) +if (c->c_dbg_lvl <EROFS_INFO )return ;erofs_dump ("\tc_version: [%8s]\n" , c->c_version);erofs_dump ("\tc_dbg_lvl: [%8d]\n" , c->c_dbg_lvl);
Signature · 1 line
2.35.0.263.gb82422642f-goog
PATCH 1/1 erofs-utils: Print program name and version to stdout
The program name and version is not an error message, so it should go to stdout, not stderr.
--- dump/main.c | 2 +- fsck/main.c | 2 +- fuse/main.c | 2 +- mkfs/main.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
dump/main.c +1 -1
@@ -109,7 +109,7 @@ static void usage(void)static void erofsdump_print_version (void ) { -fprintf (stderr,"dump.erofs %s\n" , cfg.c_version); +printf ("dump.erofs %s\n" , cfg.c_version); }static int erofsdump_parse_options_cfg (int argc,char **argv)
fsck/main.c +1 -1
@@ -43,7 +43,7 @@ static void usage(void)static void erofsfsck_print_version (void ) { -fprintf (stderr,"fsck.erofs %s\n" , cfg.c_version); +printf ("fsck.erofs %s\n" , cfg.c_version); }static int erofsfsck_parse_options_cfg (int argc,char **argv)
fuse/main.c +1 -1
@@ -210,7 +210,7 @@ int main(int argc, char *argv[])struct fuse_args args =FUSE_ARGS_INIT (argc, argv);erofs_init_configure (); -fprintf (stderr,"%s %s\n" ,basename (argv[0 ]), cfg.c_version); +printf ("%s %s\n" ,basename (argv[0 ]), cfg.c_version);#if defined(HAVE_EXECINFO_H ) && defined(HAVE_BACKTRACE )if (signal (SIGSEGV , signal_handle_sigsegv) ==SIG_ERR ) {
mkfs/main.c +1 -1
@@ -548,7 +548,7 @@ int parse_source_date_epoch(void)void erofs_show_progs (int argc,char *argv[]) {if (cfg.c_dbg_lvl >=EROFS_WARN ) -fprintf (stderr,"%s %s\n" ,basename (argv[0 ]), cfg.c_version); +printf ("%s %s\n" ,basename (argv[0 ]), cfg.c_version); }int main (int argc,char **argv)
Signature · 1 line
2.35.0.263.gb82422642f-goog
Gao Xiang
AppliedQuoted 5 lines · Peter Collingbourne
The information printed by
erofs_show_configis not useful for ordinary users of the program, and it certainly doesn't count as a warning, so let's only print it at the INFO debug level or greater.Signed-off-by Peter Collingbourne <[email protected]>
Applied, thanks!
Thanks,
Gao Xiang
Quoted 19 lines
--- lib/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/config.c +1
-1@@ -34,7 +34,7 @@ void erofs_show_config(void) {const struct erofs_configure *c = &cfg; -if (c->c_dbg_lvl <EROFS_WARN ) +if (c->c_dbg_lvl <EROFS_INFO )return ;erofs_dump ("\tc_version: [%8s]\n" , c->c_version);erofs_dump ("\tc_dbg_lvl: [%8d]\n" , c->c_dbg_lvl);Signature · 1 line
2.35.0.263.gb82422642f-goog
Gao Xiang
AppliedRe: [PATCH] erofs-utils: Print program name and version to stdout
In reply to Peter Collingbourne via Linux-erofsQuoted 4 lines · Peter Collingbourne
The program name and version is not an error message, so it should go to stdout, not stderr.
Signed-off-by Peter Collingbourne <[email protected]>
Applied, thanks!
Thanks,
Gao Xiang
Quoted 61 lines
--- dump/main.c | 2 +- fsck/main.c | 2 +- fuse/main.c | 2 +- mkfs/main.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)dump/main.c +1
-1@@ -109,7 +109,7 @@ static void usage(void)static void erofsdump_print_version (void ) { -fprintf (stderr,"dump.erofs %s\n" , cfg.c_version); +printf ("dump.erofs %s\n" , cfg.c_version); }static int erofsdump_parse_options_cfg (int argc,char **argv)fsck/main.c +1
-1@@ -43,7 +43,7 @@ static void usage(void)static void erofsfsck_print_version (void ) { -fprintf (stderr,"fsck.erofs %s\n" , cfg.c_version); +printf ("fsck.erofs %s\n" , cfg.c_version); }static int erofsfsck_parse_options_cfg (int argc,char **argv)fuse/main.c +1
-1@@ -210,7 +210,7 @@ int main(int argc, char *argv[])struct fuse_args args =FUSE_ARGS_INIT (argc, argv);erofs_init_configure (); -fprintf (stderr,"%s %s\n" ,basename (argv[0 ]), cfg.c_version); +printf ("%s %s\n" ,basename (argv[0 ]), cfg.c_version);#if defined(HAVE_EXECINFO_H ) && defined(HAVE_BACKTRACE )if (signal (SIGSEGV , signal_handle_sigsegv) ==SIG_ERR ) {mkfs/main.c +1
-1@@ -548,7 +548,7 @@ int parse_source_date_epoch(void)void erofs_show_progs (int argc,char *argv[]) {if (cfg.c_dbg_lvl >=EROFS_WARN ) -fprintf (stderr,"%s %s\n" ,basename (argv[0 ]), cfg.c_version); +printf ("%s %s\n" ,basename (argv[0 ]), cfg.c_version); }int main (int argc,char **argv)Signature · 1 line
2.35.0.263.gb82422642f-goog