Skip to content

Current function name of a log record? #455

@swsnr

Description

@swsnr

The systemd journal supports three standard fields for the code location of a log message:

grafik

In a systemd logger we can easily fill CODE_FILE and CODE_LINE from record.file() and record.line() respectively, but what about CODE_FUNCTION?

The record API doesn't have a corresponding field, and it looks as if Rust currently doesn't have a way to get the function name 😕

Is there any other means to get hold of the name of the function? It's not that important, but when it comes to logging the more information we have the better, and I think it'd be helpful to find the source of a log message even if you don't have the source code of the exact version at hands (e.g. in case a function got moved to another module).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions