DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Tyler Retzlaff <roretzla@linux.microsoft.com>
Cc: luzhipeng <luzhipeng@cestc.cn>, dev@dpdk.org, thomas@monjalon.net
Subject: Re: [PATCH v3] log: add timestamp for log
Date: Mon, 6 Mar 2023 14:03:22 -0800	[thread overview]
Message-ID: <20230306140322.702ea968@hermes.local> (raw)
In-Reply-To: <20230306210017.GC5736@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net>

On Mon, 6 Mar 2023 13:00:17 -0800
Tyler Retzlaff <roretzla@linux.microsoft.com> wrote:

> On Sat, Mar 04, 2023 at 08:04:41AM -0800, Stephen Hemminger wrote:
> > On Sat,  4 Mar 2023 16:14:21 +0800
> > luzhipeng <luzhipeng@cestc.cn> wrote:
> >   
> > > From: Zhipeng Lu <luzhipeng@cestc.cn>
> > > 
> > > add timestamp for log
> > > 
> > > Signed-off-by: Zhipeng Lu <luzhipeng@cestc.cn>  
> > 
> > Good idea but:
> >   - it needs to be optional
> >   - timestamp only makes sense on the terminal (stdout) log stream
> >     syslog/journal already have timestamp  
> 
> +1
> 
> also, some people who may have written scripts to consume the log output
> might get kind of irritated that you suddenly broke the format of the
> output. while not strictly an "api" it's not super friendly to break it
> unnecessarily.

Two additional comments.
  - since stderr is unbuffered on most OS, the fprintf of the timestamp
    and then the message is not thread safe. Writes of one thread and another might
    intermix.  Addressed that in my version by using writev
  - Putting full date is unnecessary overhead better to use seconds since startup
    (similar to kernel dmesg). Also simpler to calculate.

      reply	other threads:[~2023-03-06 22:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-04  8:14 luzhipeng
2023-03-04 16:04 ` Stephen Hemminger
2023-03-06 21:00   ` Tyler Retzlaff
2023-03-06 22:03     ` Stephen Hemminger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230306140322.702ea968@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=luzhipeng@cestc.cn \
    --cc=roretzla@linux.microsoft.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).