add log verbosity configuration to plugin components#1667
Conversation
3de3762 to
8cfd614
Compare
| gdsEnabled: null | ||
| mofedEnabled: null | ||
| deviceDiscoveryStrategy: null | ||
| logVerbosity: null |
There was a problem hiding this comment.
Do you want this to be set to 0? To let the default be visible, as set here?
There was a problem hiding this comment.
I’d prefer to keep it as null, which means the Helm chart does not set LOG_VERBOSITY, so the binary uses its built-in default of 0. Setting it to 0 would be functionally equivalent, but it would make the chart explicitly override the application default rather than inherit it.
| nvinfo.WithRoot(string(driverRoot)), | ||
| nvinfo.WithNvmlLib(nvmllib), | ||
| nvinfo.WithDeviceLib(devicelib), | ||
| nvinfo.WithLogger(&logger.NvInfoAdapter{DebugV: 1}), |
There was a problem hiding this comment.
This was intentional. DebugV: 1 only maps nvinfo's Debugf messages to klog verbosity level 1; it does not enable them by default. The default global log-verbosity is still 0, so these messages are only shown when users explicitly increase verbosity.
There was a problem hiding this comment.
Also, the verbosity setting is now encapsulated in NewNvInfoAdapter(), so the call sites no longer need to hardcode it.
8cfd614 to
f531e94
Compare
Signed-off-by: Armourstill <armourstill@hotmail.com>
f531e94 to
7fdc745
Compare
Sometimes we need to inspect logs from nvinfo, but its logging interface is not compatible with klog. To address this, I brought back the logger package and added a logging adapter for nvinfo. A fixed verbosity level of 1 is used to make debug logging as easy to enable as possible.