mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2024-11-25 13:35:00 +00:00
Make error logging less verbose by default
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
14fe35c3f4
commit
a26d02890f
@ -12,7 +12,7 @@ var logger = NewLogger()
|
||||
func main() {
|
||||
err := run(os.Args)
|
||||
if err != nil {
|
||||
logger.Errorf("Error running %v: %v", os.Args, err)
|
||||
logger.Errorf("%v", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
@ -20,6 +20,7 @@ func main() {
|
||||
// run is an entry point that allows for idiomatic handling of errors
|
||||
// when calling from the main function.
|
||||
func run(argv []string) (rerr error) {
|
||||
logger.Debugf("Running %v", argv)
|
||||
cfg, err := config.GetConfig()
|
||||
if err != nil {
|
||||
return fmt.Errorf("error loading config: %v", err)
|
||||
@ -32,7 +33,7 @@ func run(argv []string) (rerr error) {
|
||||
defer func() {
|
||||
// We capture and log a returning error before closing the log file.
|
||||
if rerr != nil {
|
||||
logger.Errorf("Error running %v: %v", argv, rerr)
|
||||
logger.Errorf("%v", rerr)
|
||||
}
|
||||
logger.CloseFile()
|
||||
}()
|
||||
|
Loading…
Reference in New Issue
Block a user