Change logging to default to Error/Critical
Historically, logging has been disabled in bmcweb for two reasons.
First, the crow logging handler used iostreams, which can bloat binary
sizes if there are lots of logging call sites.
Second, the amount of logging and the levels at which is was performed
were not very carefully selected by either crow, or the follow on
bmcweb. A number of log calls logged at Error or Critical level that
are fully expected to occur in a normally operating service.
The first was corrected with commit 62598e3, which replaced the
iostreams logger with c++20 compliant std::format.
The second was corrected by Gunnar, documenting when and where to log
different levels in commit 0e88cb3, and a series of commits after
making the levels usage more consistent.
With those two changes in place and showing the appearance of being
functional, this patchset is recommending that we change the default
error level to log Critical and Error levels by default.
A number of organizations have already made this change to their local
systems [1], opting for varying levels. Given that we're now internally
consistent, this is going to request that we modify those systems to
accept defaults once again.
There are two negatives to this being the default.
1. We take a 2.7% increase (about 27KB) in binary size. Given the last
couple years of reductions in the default binary size, this shouldn't
cause any platforms to go over their flash limit, and we're still well
within the documented size targets.
2. Error paths now log, which slows down the result, and increases the
potential that a DOS attack or test will slow down real results. This
concern is hypothetical at best, but we will have to watch for repeated
patterns emerging and evaluate if this is a potential problem.
Please comment.
[1] https://github.com/search?q=repo%3Aopenbmc%2Fopenbmc%20bmcweb-logging&type=code
Change-Id: Ib32654c3bcbcbee567f3bd7abd003411dd9e489a
Signed-off-by: Ed Tanous <ed@tanous.net>
diff --git a/meson_options.txt b/meson_options.txt
index fe5aa00..0e7df3a 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -140,7 +140,7 @@
'bmcweb-logging',
type: 'combo',
choices : [ 'disabled', 'enabled', 'debug', 'info', 'warning', 'error', 'critical' ],
- value: 'disabled',
+ value: 'error',
description: '''Enable output the extended logging level.
- disabled: disable bmcweb log traces.
- enabled: treated as 'debug'