mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2024-11-22 08:18:32 +00:00
Call logger.Reset() to ensure errors are captured
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
19138a2110
commit
60dacb76b6
@ -118,9 +118,9 @@ func UpdateLogger(filename string, logLevel string, argv []string) (*Logger, err
|
||||
return l, nil
|
||||
}
|
||||
|
||||
// CloseFile closes the log file (if any) and resets the logger output to what it
|
||||
// Reset closes the log file (if any) and resets the logger output to what it
|
||||
// was before UpdateLogger was called.
|
||||
func (l *Logger) CloseFile() error {
|
||||
func (l *Logger) Reset() error {
|
||||
defer func() {
|
||||
previous := l.previousLogger
|
||||
if previous == nil {
|
||||
|
@ -35,6 +35,7 @@ func run(argv []string) (rerr error) {
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to set up logger: %v", err)
|
||||
}
|
||||
defer logger.Reset()
|
||||
|
||||
logger.Debugf("Command line arguments: %v", argv)
|
||||
runtime, err := newNVIDIAContainerRuntime(logger.Logger, cfg, argv)
|
||||
|
Loading…
Reference in New Issue
Block a user