mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-07-19 03:54:11 -04:00
defensive code
This commit is contained in:
@@ -64,7 +64,8 @@ func NewLogger(opts ...Option) Logger {
|
||||
} else if options.File != "" {
|
||||
f, err := os.OpenFile(options.File, os.O_CREATE|os.O_APPEND|os.O_RDWR, 0644)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
print(fmt.Sprintf("file could not be opened for writing: %s. error: %v", options.File, err))
|
||||
os.Exit(1)
|
||||
}
|
||||
logger = logger.Output(f)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user