* [PATCH] erofs-utils: Print configuration only at INFO debug level @ 2022-02-09 0:53 Peter Collingbourne via Linux-erofs 2022-02-09 0:53 ` [PATCH] erofs-utils: Print program name and version to stdout Peter Collingbourne via Linux-erofs 2022-02-09 1:47 ` [PATCH] erofs-utils: Print configuration only at INFO debug level Gao Xiang 0 siblings, 2 replies; 4+ messages in thread From: Peter Collingbourne via Linux-erofs @ 2022-02-09 0:53 UTC (permalink / raw) To: xiang; +Cc: Peter Collingbourne, linux-erofs 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. Signed-off-by: Peter Collingbourne <pcc@google.com> --- lib/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/config.c b/lib/config.c index 363dcc5..08deb6f 100644 --- a/lib/config.c +++ b/lib/config.c @@ -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); -- 2.35.0.263.gb82422642f-goog ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] erofs-utils: Print program name and version to stdout 2022-02-09 0:53 [PATCH] erofs-utils: Print configuration only at INFO debug level Peter Collingbourne via Linux-erofs @ 2022-02-09 0:53 ` Peter Collingbourne via Linux-erofs 2022-02-09 1:48 ` Gao Xiang 2022-02-09 1:47 ` [PATCH] erofs-utils: Print configuration only at INFO debug level Gao Xiang 1 sibling, 1 reply; 4+ messages in thread From: Peter Collingbourne via Linux-erofs @ 2022-02-09 0:53 UTC (permalink / raw) To: xiang; +Cc: Peter Collingbourne, linux-erofs The program name and version is not an error message, so it should go to stdout, not stderr. Signed-off-by: Peter Collingbourne <pcc@google.com> --- dump/main.c | 2 +- fsck/main.c | 2 +- fuse/main.c | 2 +- mkfs/main.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dump/main.c b/dump/main.c index b7560ec..ad1b62e 100644 --- a/dump/main.c +++ b/dump/main.c @@ -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) diff --git a/fsck/main.c b/fsck/main.c index aefa881..2ebc5e9 100644 --- a/fsck/main.c +++ b/fsck/main.c @@ -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) diff --git a/fuse/main.c b/fuse/main.c index 255965e..b7760e4 100644 --- a/fuse/main.c +++ b/fuse/main.c @@ -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) { diff --git a/mkfs/main.c b/mkfs/main.c index 58a6441..4325ab4 100644 --- a/mkfs/main.c +++ b/mkfs/main.c @@ -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) -- 2.35.0.263.gb82422642f-goog ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] erofs-utils: Print program name and version to stdout 2022-02-09 0:53 ` [PATCH] erofs-utils: Print program name and version to stdout Peter Collingbourne via Linux-erofs @ 2022-02-09 1:48 ` Gao Xiang 0 siblings, 0 replies; 4+ messages in thread From: Gao Xiang @ 2022-02-09 1:48 UTC (permalink / raw) To: Peter Collingbourne; +Cc: linux-erofs On Tue, Feb 08, 2022 at 04:53:07PM -0800, Peter Collingbourne wrote: > The program name and version is not an error message, so it should > go to stdout, not stderr. > > Signed-off-by: Peter Collingbourne <pcc@google.com> Applied, thanks! Thanks, Gao Xiang > --- > dump/main.c | 2 +- > fsck/main.c | 2 +- > fuse/main.c | 2 +- > mkfs/main.c | 2 +- > 4 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/dump/main.c b/dump/main.c > index b7560ec..ad1b62e 100644 > --- a/dump/main.c > +++ b/dump/main.c > @@ -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) > diff --git a/fsck/main.c b/fsck/main.c > index aefa881..2ebc5e9 100644 > --- a/fsck/main.c > +++ b/fsck/main.c > @@ -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) > diff --git a/fuse/main.c b/fuse/main.c > index 255965e..b7760e4 100644 > --- a/fuse/main.c > +++ b/fuse/main.c > @@ -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) { > diff --git a/mkfs/main.c b/mkfs/main.c > index 58a6441..4325ab4 100644 > --- a/mkfs/main.c > +++ b/mkfs/main.c > @@ -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) > -- > 2.35.0.263.gb82422642f-goog ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] erofs-utils: Print configuration only at INFO debug level 2022-02-09 0:53 [PATCH] erofs-utils: Print configuration only at INFO debug level Peter Collingbourne via Linux-erofs 2022-02-09 0:53 ` [PATCH] erofs-utils: Print program name and version to stdout Peter Collingbourne via Linux-erofs @ 2022-02-09 1:47 ` Gao Xiang 1 sibling, 0 replies; 4+ messages in thread From: Gao Xiang @ 2022-02-09 1:47 UTC (permalink / raw) To: Peter Collingbourne; +Cc: linux-erofs On Tue, Feb 08, 2022 at 04:53:06PM -0800, Peter Collingbourne wrote: > 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. > > Signed-off-by: Peter Collingbourne <pcc@google.com> Applied, thanks! Thanks, Gao Xiang > --- > lib/config.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/config.c b/lib/config.c > index 363dcc5..08deb6f 100644 > --- a/lib/config.c > +++ b/lib/config.c > @@ -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); > -- > 2.35.0.263.gb82422642f-goog ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-02-09 1:48 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2022-02-09 0:53 [PATCH] erofs-utils: Print configuration only at INFO debug level Peter Collingbourne via Linux-erofs 2022-02-09 0:53 ` [PATCH] erofs-utils: Print program name and version to stdout Peter Collingbourne via Linux-erofs 2022-02-09 1:48 ` Gao Xiang 2022-02-09 1:47 ` [PATCH] erofs-utils: Print configuration only at INFO debug level Gao Xiang
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox