diff mbox series

[01/10] base-files: upgrade: log with prefix

Message ID 20201103122107.30400-2-yszhou4tech@gmail.com
State Superseded, archived
Delegated to: Yousong Zhou
Headers show
Series sysupgrade: reword and organize log lines | expand

Commit Message

Yousong Zhou Nov. 3, 2020, 12:20 p.m. UTC
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
---
 package/base-files/files/lib/upgrade/common.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Adrian Schmutzler Nov. 3, 2020, 1:02 p.m. UTC | #1
Hi,

> -----Original Message-----
> From: openwrt-devel [mailto:openwrt-devel-bounces@lists.openwrt.org]
> On Behalf Of Yousong Zhou
> Sent: Dienstag, 3. November 2020 13:21
> To: Philip Prindeville <philipp@redfish-solutions.com>
> Cc: Yousong Zhou <yszhou4tech@gmail.com>; openwrt-
> devel@lists.openwrt.org
> Subject: [PATCH 01/10] base-files: upgrade: log with prefix
> 
> Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
> ---
>  package/base-files/files/lib/upgrade/common.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/package/base-files/files/lib/upgrade/common.sh
> b/package/base-files/files/lib/upgrade/common.sh
> index 2eb26ba44b..56daabd778 100644
> --- a/package/base-files/files/lib/upgrade/common.sh
> +++ b/package/base-files/files/lib/upgrade/common.sh
> @@ -64,7 +64,7 @@ ask_bool() {
>  }
> 
>  v() {

Generally, I like the idea. I'm not sure whether just v() is a good choice for the function name, though.

> -	[ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo "$@"
> +	[ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo "== upgrade:
> $@"

Is there a particular reason for choosing "==" as prefix or is this arbitrary? Looks a bit odd to me (not the fact of having a prefix, but the prefix itself) ...

In any case, thanks for the improvements.

Best

Adrian

>  }
> 
>  json_string() {
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Yousong Zhou Nov. 3, 2020, 3:04 p.m. UTC | #2
On Tue, 3 Nov 2020 at 21:02, Adrian Schmutzler <mail@adrianschmutzler.de> wrote:
>
> Hi,
>
> > -----Original Message-----
> > From: openwrt-devel [mailto:openwrt-devel-bounces@lists.openwrt.org]
> > On Behalf Of Yousong Zhou
> > Sent: Dienstag, 3. November 2020 13:21
> > To: Philip Prindeville <philipp@redfish-solutions.com>
> > Cc: Yousong Zhou <yszhou4tech@gmail.com>; openwrt-
> > devel@lists.openwrt.org
> > Subject: [PATCH 01/10] base-files: upgrade: log with prefix
> >
> > Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
> > ---
> >  package/base-files/files/lib/upgrade/common.sh | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/package/base-files/files/lib/upgrade/common.sh
> > b/package/base-files/files/lib/upgrade/common.sh
> > index 2eb26ba44b..56daabd778 100644
> > --- a/package/base-files/files/lib/upgrade/common.sh
> > +++ b/package/base-files/files/lib/upgrade/common.sh
> > @@ -64,7 +64,7 @@ ask_bool() {
> >  }
> >
> >  v() {
>
> Generally, I like the idea. I'm not sure whether just v() is a good choice for the function name, though.
>
> > -     [ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo "$@"
> > +     [ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo "== upgrade:
> > $@"
>
> Is there a particular reason for choosing "==" as prefix or is this arbitrary? Looks a bit odd to me (not the fact of having a prefix, but the prefix itself) ...

I should have mentioned this in the cover letter ;)

"==" is there mainly to make the lines stand out by looking a bit
different.  I tried other characters like "--", "##" etc.  "==" seems
the best.  "$(date)" was also tried for once but it's not available at
later stages of sysupgrade.  Maybe I should try again and use datetime
as the prefix.

Regards,
                yousong

>
> In any case, thanks for the improvements.
>
> Best
>
> Adrian
>
> >  }
> >
> >  json_string() {
> >
> > _______________________________________________
> > openwrt-devel mailing list
> > openwrt-devel@lists.openwrt.org
> > https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Adrian Schmutzler Nov. 3, 2020, 3:09 p.m. UTC | #3
Hi,

> -----Original Message-----
> From: Yousong Zhou [mailto:yszhou4tech@gmail.com]
> Sent: Dienstag, 3. November 2020 16:05
> To: Adrian Schmutzler <mail@adrianschmutzler.de>
> Cc: Philip Prindeville <philipp@redfish-solutions.com>; OpenWrt
> Development List <openwrt-devel@lists.openwrt.org>
> Subject: Re: [PATCH 01/10] base-files: upgrade: log with prefix
> 
> On Tue, 3 Nov 2020 at 21:02, Adrian Schmutzler <mail@adrianschmutzler.de>
> wrote:
> >
> > Hi,
> >
> > > -----Original Message-----
> > > From: openwrt-devel [mailto:openwrt-devel-
> bounces@lists.openwrt.org]
> > > On Behalf Of Yousong Zhou
> > > Sent: Dienstag, 3. November 2020 13:21
> > > To: Philip Prindeville <philipp@redfish-solutions.com>
> > > Cc: Yousong Zhou <yszhou4tech@gmail.com>; openwrt-
> > > devel@lists.openwrt.org
> > > Subject: [PATCH 01/10] base-files: upgrade: log with prefix
> > >
> > > Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
> > > ---
> > >  package/base-files/files/lib/upgrade/common.sh | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/package/base-files/files/lib/upgrade/common.sh
> > > b/package/base-files/files/lib/upgrade/common.sh
> > > index 2eb26ba44b..56daabd778 100644
> > > --- a/package/base-files/files/lib/upgrade/common.sh
> > > +++ b/package/base-files/files/lib/upgrade/common.sh
> > > @@ -64,7 +64,7 @@ ask_bool() {
> > >  }
> > >
> > >  v() {
> >
> > Generally, I like the idea. I'm not sure whether just v() is a good choice for
> the function name, though.
> >
> > > -     [ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo "$@"
> > > +     [ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo "== upgrade:
> > > $@"
> >
> > Is there a particular reason for choosing "==" as prefix or is this arbitrary?
> Looks a bit odd to me (not the fact of having a prefix, but the prefix itself) ...
> 
> I should have mentioned this in the cover letter ;)
> 
> "==" is there mainly to make the lines stand out by looking a bit different.  I
> tried other characters like "--", "##" etc.  "==" seems the best.  "$(date)" was
> also tried for once but it's not available at later stages of sysupgrade.  Maybe
> I should try again and use datetime as the prefix.

I don't want to make it more complicated than necessary.
The date might separate the lines from the others as well, but I'm not sure whether that would really make it easier to read eventually ...

Best

Adrian

> 
> Regards,
>                 yousong
> 
> >
> > In any case, thanks for the improvements.
> >
> > Best
> >
> > Adrian
> >
> > >  }
> > >
> > >  json_string() {
> > >
> > > _______________________________________________
> > > openwrt-devel mailing list
> > > openwrt-devel@lists.openwrt.org
> > > https://lists.openwrt.org/mailman/listinfo/openwrt-devel
diff mbox series

Patch

diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh
index 2eb26ba44b..56daabd778 100644
--- a/package/base-files/files/lib/upgrade/common.sh
+++ b/package/base-files/files/lib/upgrade/common.sh
@@ -64,7 +64,7 @@  ask_bool() {
 }
 
 v() {
-	[ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo "$@"
+	[ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo "== upgrade: $@"
 }
 
 json_string() {