I have looked at plenty of Internet resources and I still have not found a good source of information for what is used for trace vs debug. This is in Rust tracing, so there are no stack traces on trace logs. It's just another log level. When should I use TRACE over DEBUG?
Rust log
, tracing
, and many others have the following log levels.
Here is when to use each, with examples.
panic!()
, but I might as well include it either way.FATAL: Syntax error in configuration file. Aborting.
ERROR: Broken pipe responding to request
INFO: Server listening on port 80
INFO: Logged into <API> as <USER>.
INFO: Completed daily database expiration task.
DEBUG
logs should basically always only log variables or decisions. You could use DEBUG logs whenever there's variables you need to log, or after a major decision like "user did this" or "choosing to use chunked sending"