-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathlogger_options.go
More file actions
29 lines (26 loc) · 925 Bytes
/
logger_options.go
File metadata and controls
29 lines (26 loc) · 925 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package hclogutils
import (
"github.com/hashicorp/go-hclog"
)
// LoggerOptionsCopy will safely copy LoggerOptions. Manually implemented
// to save importing a dependency such as github.com/mitchellh/copystructure.
func LoggerOptionsCopy(src *hclog.LoggerOptions) *hclog.LoggerOptions {
if src == nil {
return nil
}
return &hclog.LoggerOptions{
AdditionalLocationOffset: src.AdditionalLocationOffset,
Color: src.Color,
DisableTime: src.DisableTime,
Exclude: src.Exclude,
IncludeLocation: src.IncludeLocation,
IndependentLevels: src.IndependentLevels,
JSONFormat: src.JSONFormat,
Level: src.Level,
Mutex: src.Mutex,
Name: src.Name,
Output: src.Output,
TimeFormat: src.TimeFormat,
TimeFn: src.TimeFn,
}
}