Skip to content

RFC: Make RUST_LOG={error,warning,debug,all} work #2033

Description

@pcwalton

The RUST_LOG syntax is very mysterious right now. I propose a syntax that looks like this:

  • RUST_LOG=all — logs everything.
  • RUST_LOG=error — logs errors.
  • RUST_LOG=e — same as above.
  • RUST_LOG=warning — logs errors and warnings.
  • RUST_LOG=warning,typeck — logs errors and warnings in modules nested somewhere within a module named "typeck" (including deeper modules).
  • RUST_LOG=all,typeck,trans — logs all messages coming from a module named "typeck" and all messages coming from a module named "trans"
  • RUST_LOG=debug,rustc::middle::typeck — logs errors and warnings in modules nested somewhere within a module named "typeck" inside a module named "middle" inside a module named "rustc"
  • RUST_LOG=help — displays a help message in the runtime, then exits.

IMHO this would be easy to use.

Basically the log statement would pass a list of module names to the runtime, and the logging function would do a string comparison on each path component to determine which to print.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions