2

Often I've used the flags like -lruntime=debug or -lparachain=debug without really understanding how they work. I know that the env_logger crate allows you to specify which crates to emit log messages from like so: RUST_LOG=my_app but what about substrate/polkadot? Does it use env_logger or something else to enable crate level logging? Also, what significance does the string after the -l have? Does it specify, for instance, the crate named parachain in -lparachain=debug?

1 Answer 1

1

-l is essentially the same as RUST_LOG(which we also support BTW). You can pass the following values:

  • One log level (error, warn, info, debug, trace) that applies to all targets.
  • target=log level. The target is what you can specify as target to the logging macros or the crate name if you don't pass a target.

We are using tracing for logging which is a compatible log implementation.

2
  • Ah so -l<target> is equivalent to RUST_LOG=target. Strange I've never seen it mentioned before in either log or env_logger docs. Jan 28 at 16:34
  • 1
    That is a substrate feature not any generic feature (the -l)
    – bkchr
    Jan 28 at 17:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.