mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2024-11-22 00:08:11 +00:00
Log config in JSON if possible
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
406a5ec76f
commit
456d2864a6
@ -17,6 +17,7 @@
|
||||
package runtime
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
@ -62,7 +63,14 @@ func (r rt) Run(argv []string) (rerr error) {
|
||||
r.logger.Reset()
|
||||
}()
|
||||
|
||||
r.logger.Infof("Using config %+v", cfg)
|
||||
// Print the config to the output.
|
||||
configJSON, err := json.MarshalIndent(cfg, "", " ")
|
||||
if err == nil {
|
||||
r.logger.Infof("Running with config:\n%v", string(configJSON))
|
||||
} else {
|
||||
r.logger.Infof("Running with config:\n%+v", cfg)
|
||||
}
|
||||
|
||||
r.logger.Debugf("Command line arguments: %v", argv)
|
||||
runtime, err := newNVIDIAContainerRuntime(r.logger.Logger, cfg, argv)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user