Per-module logging with glog
I spent a few hours trying to implement per-module logging in the
Mesos logging toggle. The Google
logging library supports the
--vmodule
flags to toggle the logging level on a per-module
basis, which looked promising. You can set this at run time using the
SelVLOGLevel
API.
Unfortunately, the implementation of the VLOG_IS_ON macro is such that you need to set a per-module log level before the logging call site is hit for the first time, so this is clearly intended only for startup. You can’t dial up logging on arbitrary logging modules at any time.