DPDK patches and discussions
 help / color / mirror / Atom feed
From: Feng Li <lifeng1519@gmail.com>
To: stephen@networkplumber.org
Cc: David Marchand <david.marchand@redhat.com>,
	Li Feng <fengli@smartx.com>,
	 Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>,
	 Narcisa Ana Maria Vasile <navasile@linux.microsoft.com>,
	Dmitry Malloy <dmitrym@microsoft.com>,
	 Pallavi Kadam <pallavi.kadam@intel.com>, dev <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] log: support custom log function
Date: Sat, 6 Feb 2021 01:06:10 +0800	[thread overview]
Message-ID: <CAEK8JBBdnyGqRJxeMymX4QZh_CHgWZ89YorhMF09Gb7a6roi_Q@mail.gmail.com> (raw)
In-Reply-To: <CAEK8JBDKSB0OzGf+VHb1WUgqYGNTxGMmJmWFBU0a_XYMC90RUg@mail.gmail.com>

Feng Li <lifeng1519@gmail.com> 于2021年2月6日周六 上午12:54写道:
>
> Stephen Hemminger <stephen@networkplumber.org> 于2021年2月6日周六 上午12:11写道:
> >
> > On Fri, 5 Feb 2021 12:55:48 +0100
> > David Marchand <david.marchand@redhat.com> wrote:
> >
> > > On Fri, Feb 5, 2021 at 12:25 PM Li Feng <fengli@smartx.com> wrote:
> > > >
> > > > Currently, the dpdk log is out to stdout/stderr and syslog.
> > > > We should support to output the log to another please, e.g. file or
> > > > glog.
> > >
> > > Why not use rte_openlog_stream() / rte_log_get_stream() ?
> >
> > Agree, I have used rte_openlog_stream several times to do this.
> As Dmitry Kozlyuk said, FILE* is convenient for the C/libc, but not
> for other languages.
> C++ standard IO stream is the case.

The usage is like this:
| +static ssize_t eal_log_func(void* c, const char* buf, size_t size) {
| +    int glog_level = google::GLOG_INFO;
| +    (void)c;
| +    google::LogMessage(__FILE__, __LINE__, glog_level).stream()
| +        << "[DPDK/" << __FUNCTION__ << "] " << std::string(buf, size);
| +    return 0;
| +}

  reply	other threads:[~2021-02-07  9:38 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-05 11:24 Li Feng
2021-02-05 11:31 ` Feng Li
2021-02-05 11:55 ` David Marchand
2021-02-05 12:22   ` Feng Li
2021-02-05 14:08     ` Dmitry Kozlyuk
2021-02-05 16:39     ` Stephen Hemminger
2021-02-05 16:10   ` Stephen Hemminger
2021-02-05 16:54     ` Feng Li
2021-02-05 17:06       ` Feng Li [this message]
2021-02-05 17:42 ` [dpdk-dev] [PATCH v2] " Li Feng
2021-02-05 17:47   ` Feng Li
2021-02-05 19:32   ` Dmitry Kozlyuk
2021-02-08  6:58     ` Feng Li
2021-02-08 22:40       ` Dmitry Kozlyuk
2021-02-10  3:59         ` Feng Li
2021-02-10  5:20 ` [dpdk-dev] [PATCH v3] " Li Feng
2021-02-18  2:55   ` Feng Li
2023-06-15 16:12   ` Stephen Hemminger
2021-02-18  6:12 ` [dpdk-dev] [PATCH v4] " Li Feng
2021-02-19  8:11   ` Dmitry Kozlyuk
2021-02-23 11:22     ` Feng Li

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=CAEK8JBBdnyGqRJxeMymX4QZh_CHgWZ89YorhMF09Gb7a6roi_Q@mail.gmail.com \
    --to=lifeng1519@gmail.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=dmitry.kozliuk@gmail.com \
    --cc=dmitrym@microsoft.com \
    --cc=fengli@smartx.com \
    --cc=navasile@linux.microsoft.com \
    --cc=pallavi.kadam@intel.com \
    --cc=stephen@networkplumber.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).