diff options
Diffstat (limited to 'ui/logger')
-rw-r--r-- | ui/logger/logger.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ui/logger/logger.go b/ui/logger/logger.go index db7e82ad7..7d9687bec 100644 --- a/ui/logger/logger.go +++ b/ui/logger/logger.go @@ -145,13 +145,14 @@ func New(out io.Writer) *stdLogger { // SetVerbose controls whether Verbose[f|ln] logs to stderr as well as the // file-backed log. -func (s *stdLogger) SetVerbose(v bool) { +func (s *stdLogger) SetVerbose(v bool) *stdLogger { s.verbose = v + return s } // SetOutput controls where the file-backed log will be saved. It will keep // some number of backups of old log files. -func (s *stdLogger) SetOutput(path string) { +func (s *stdLogger) SetOutput(path string) *stdLogger { if f, err := CreateFileWithRotation(path, 5); err == nil { s.mutex.Lock() defer s.mutex.Unlock() @@ -164,6 +165,7 @@ func (s *stdLogger) SetOutput(path string) { } else { s.Fatal(err.Error()) } + return s } // Close disables logging to the file and closes the file handle. |