How to ideally fix the log function

vishwa vishwa at linux.vnet.ibm.com
Thu Jul 25 21:21:49 AEST 2019


Hi John,

Just some background; The goal is not to have func() pass in CODE_LINE 
and CODE_FUNC since it would be a huge change all over in the code. So 
the plan was to see if something can be done under the cover with no 
impacts to current usage of the API.

!! Vishwa !!

On 7/25/19 6:35 AM, John Wang wrote:
> 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