Different logging targets #3375
tastyherring
started this conversation in
General
Replies: 1 comment 3 replies
-
You can pass different log levels for each logger by environment variables or argv.
The logger will have its log level set when it is registered in the spdlog registry. spdlog/include/spdlog/details/registry-inl.h Lines 65 to 68 in 48bcf39 Tip You must create the loggers yourself. See also tests: https://github.com/gabime/spdlog/blob/v1.15.2/tests/test_cfg.cpp |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I would like to have different logging targets with a single application so I can vary the log levels for these different things.
Something like
MYAPP_LEVEL=info,target1=trace,target2=info
Rust's logging trait does this with a logging
target
, in the meta data recorded at each callsite?https://docs.rs/log/latest/log/struct.Metadata.html#method.target
What is the approach to achieving this with SPDLOG? Do I need to define different loggers for each 'target' or is there any example of this this might be done.
Beta Was this translation helpful? Give feedback.
All reactions