Skip to content
This repository was archived by the owner on Jun 23, 2021. It is now read-only.

Definition of Logging Levels

Marcel Frei edited this page May 14, 2019 · 1 revision

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!(...)).

ERROR

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

WARN

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

INFO

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

DEBUG

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

TRACE

The TRACE level should be used to output all information that helps us trace the processing of data in the software.

Clone this wiki locally