-
Notifications
You must be signed in to change notification settings - Fork 23
Definition of Logging Levels
We use in the code the env_logger infrastructure to output relevant information.
This document describes the meaning of the different log levels.
IMPORTANT: Information that the user must see, should not be output as log messages (i.e. use println!(...) instead of info!(...)).
The ERROR level should be used when the application really is in trouble. The software encounters an unexpected error which prevents further processing.
Take care not to use this logging level too generously because that would add too much noise to the logs and reduce the significance of a single ERROR event.
Examples:
- Fail to call a function in the enclave
The WARN level should be used when something bad or unexpected happened, but the software still has the chance to heal itself.
The software can try again later and it might ultimately result in an ERROR log message when the retry-mechanism also fails.
Examples:
- A configuration is incomplete
The INFO level should be used to document state changes in the application or some entity within the application.
Examples:
- An extrinsic is sent to the blockchain
The DEBUG level should be used to output any information that helps us identify what went wrong and what information is processed.
Examples:
- JSON content of received and sent messages
The TRACE level should be used to output all information that helps us trace the processing of data in the software.