From: Tzvetomir Stoyanov <tz.stoyanov@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Linux Trace Devel <linux-trace-devel@vger.kernel.org>
Subject: Re: [PATCH 2/4] libtraceevent: Add logs with severity info
Date: Wed, 5 May 2021 07:45:44 +0300 [thread overview]
Message-ID: <CAPpZLN4opBm_OQm2HYH73PmpBOmV9VMaV1vt+Wx_EzjOOAPWcw@mail.gmail.com> (raw)
In-Reply-To: <20210504162425.5cced88c@gandalf.local.home>
On Tue, May 4, 2021 at 11:24 PM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> On Wed, 28 Apr 2021 10:29:59 +0300
> "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com> wrote:
>
> > void tep_info(const char *fmt, ...)
> > {
> > va_list ap;
> >
> > if (log_level < TEP_LOG_INFO)
> > return;
> >
> > va_start(ap, fmt);
> > tep_vprint("libtraceevent", TEP_LOG_INFO fmt, ap);
> > va_end(ap);
> > }
>
> The above should just be:
>
> void tep_info(const char *fmt, ...)
> {
> va_list ap;
>
> va_start(ap, fmt);
> tep_vprint("libtraceevent", TEP_LOG_INFO fmt, ap);
> va_end(ap);
> }
>
> And let the tep_vprint() decide to print it or not.
The tep_vprint() is used also by libtacecmd and libtracefs for
printing logs. Each library has its own log_level local variable,
that's why I check the log level in the library specific log
functions.
>
> -- Steve
--
Tzvetomir (Ceco) Stoyanov
VMware Open Source Technology Center
next prev parent reply other threads:[~2021-05-05 4:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-28 7:29 [PATCH 0/4] Add severity to library logs Tzvetomir Stoyanov (VMware)
2021-04-28 7:29 ` [PATCH 1/4] libtraceevent: Add log levels Tzvetomir Stoyanov (VMware)
2021-04-28 7:29 ` [PATCH 2/4] libtraceevent: Add logs with severity info Tzvetomir Stoyanov (VMware)
2021-05-04 20:00 ` Steven Rostedt
2021-05-04 20:34 ` Steven Rostedt
2021-05-04 20:24 ` Steven Rostedt
2021-05-05 4:45 ` Tzvetomir Stoyanov [this message]
2021-05-05 9:55 ` Steven Rostedt
2021-04-28 7:30 ` [PATCH 3/4] libtraceevent: Rename tep_vwarning() to tep_vprint() Tzvetomir Stoyanov (VMware)
2021-05-04 20:22 ` Steven Rostedt
2021-04-28 7:30 ` [PATCH 4/4] libtraceevent: Document new log functionality Tzvetomir Stoyanov (VMware)
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=CAPpZLN4opBm_OQm2HYH73PmpBOmV9VMaV1vt+Wx_EzjOOAPWcw@mail.gmail.com \
--to=tz.stoyanov@gmail.com \
--cc=linux-trace-devel@vger.kernel.org \
--cc=rostedt@goodmis.org \
/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).