Skip to content

Enable logging by topic (RUST_LOG like). #323

Description

@Saizan

Something I quite liked from Agda dev and seems to be the standard in Rust is the ability to turn on logging selectively.

e.g. Rust default logging setup uses an env var called RUST_LOG:

The RUST_LOG environment variable controls logging with the syntax:

RUST_LOG=[target][=][level][,...]

Or in other words, its a comma-separated list of directives. Directives can filter by target, by level, or both (using =).

For example,

RUST_LOG=data=debug,hardware=debug

target is typically the path of the module the message in question originated from, though it can be overridden. The path is rooted in the name of the crate it was compiled for, so if your program is in a file called, for example, hello.rs, the path would simply be hello.

Should we add something like this to hdb? That was we can keep more logging code in there for investigating bugs without drowning in logs everytime.

We would grandfather into the system the existing logging as the default target and define other targets by module or logical unit as needed. They would be hierarchical too, so you can turn on a whole tree or really zoom in into a specific corner.

@alt-romes what do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions