Closed thibault-martinez closed 2 years ago
Maybe it would also help to define what each of the levels stand for. Currently we are using the following log levels: error
, warn
, info
, debug
, and trace
.
error
and warn
are probably self-explanatory, but the distinction between debug
and info
is a bit trickier. In my opinion, info
should only contain messages that are essential to the user. Here is a list of things that I think fit the info
level well:
2022-01-24 13:29:19 (UTC) bee_node::fullnode::builder INFO Joining network "chrysalis-mainnet"(1454675179895816119). Bech32 hrp "iota".
2022-01-24 13:29:19 (UTC) bee_node::fullnode::builder INFO PeerId: 12D3KooWSEaafBZ6LjTdr2EvtpbmxpVoqHYZHLcFfEC6wUZdPqCM, Alias: bee
2022-01-24 13:29:19 (UTC) bee_ledger::workers::snapshot::worker INFO Loaded snapshot from 2022-01-18 10:53:33 (UTC) with snapshot index 2280928, entry point index 2280928 and pruning index 2280928.
But the log also contains things that are less important to the user:
2022-01-24 13:29:19 (UTC) bee_protocol::workers::requester::message INFO Retryer running.
2022-01-24 13:29:20 (UTC) bee_protocol::workers::message::processor INFO Running.
2022-01-24 13:29:32 (UTC) bee_protocol::workers::message::submitter INFO Stopped.
One thing that's common to these is that they notify about the state of certain subcomponents of Bee. However, most users don't even know what these components are, so maybe we should move those to debug?
In my opinion, info should only contain messages that are essential to the user
Definitely agree, although I guess not necessarily essential to the user, but they should be something the user might want and would understand. The second group there look more appropriate for debug logs to me.
WARNING
for autopeering withDISCLAIMER
Flushing data to peer store...
shouldn't be INFO