How to ideally fix the log function

John Wang wangzhiqiang8906 at gmail.com
Thu Jul 25 11:05:36 AEST 2019


Hi all

I am just curious about how to ideally fix the log function

Currently,error log code location metadata is not useful, link:
https://github.com/openbmc/openbmc/issues/2297

That issue mentioned several solutions,But I am still confused.

The call stack of phsophor::logging:log<>() is like this:

func() -> log<>() -> helper_log() -> sd_journal_send

We need to pass arguments(CODE_LINE and CODE_FILE) from `func` to
`sd_journal_send`,right?

Ideally:

template <level L, typename Msg, typename... Entry>
void log(Msg msg, Entry... e,
  const source_location& location = source_location::current())

but packs must be last.

is there any suggestions ?


More information about the openbmc mailing list