WIP: Logging: Narrow the interface
Before raising this MR, consider whether the following are required, and complete if so:
-
Unit tests: difficult to unit test this, looking for suggestions. -
Metrics: not needed -
Documentation update(s)
If not required, please explain in brief why not.
Description
Narrow the interface of the logging so that we don't expose as much private implementation to the users of buildbox-common logging. Specifically attempt to avoid leaking that glog is in use so that users do not become reliant on the internals.
Also make a few attempts short circuiting the logging code based on the log levels. For example, do not try and write the log prefix unless that particular level is enabled (mostly useful for debug and below). Glog currently doesn't provide facilities to determine whether INFO and above are on, so we just rely on whatever glog does under the hood.