Skip to content

add a way to set an indentation level #79

@oli-obk

Description

@oli-obk

Debug logs are very linear. It's often very hard to detect when a specific scope of some kind has been left. I can probably implement it without it being a breaking change. Here's my design idea:

Add set_indent and get_indent methods to the Log trait with default impls that do nothing. Add a log_indent! macro to set the log indent, increase it by one or decrease it by one depending on the args. Future work might also make it create a scope lock to decrease the scope level again at the end of the scope.

Does anything speak against doing this? Technically I could do it as a new logger impl, but it would be very tedious to repeat the entire env logger impl.
Change env_logger to indent the log message by the current level.

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