Use these rules when writing new code that prints log messages.
These are failures that are expected to occur and are handled internally by the
code. Use a low level (INFO
) or don't log them at all.
Examples: missing ChassisConfig or pipeline on first startup.
Some failures will repeatedly print the same message without adding any new
information. Consider using LOG_FIRST_N()
with no more than 3 repetitions.
Examples: unconfigured ports on Tofino.
Transient failures are temporary in nature and resolve on their on, either
after some time passes or after a condition changes. This means that a later
retry of same operation has a chance of success. Use LOG_EVERY_N()
with N
between 10-100, depending on the frequency of the error. Aim for a rate of no
more than 1 message/second.
Examples: failed PacketOut transmission because a link is down.