diff options
| author | tjpcc <tjp@ctrl-c.club> | 2023-09-28 08:08:48 -0600 |
|---|---|---|
| committer | tjpcc <tjp@ctrl-c.club> | 2023-10-09 08:47:37 -0600 |
| commit | 6e1c25af361dde4c063eccbf769e966df4b65f23 (patch) | |
| tree | d28044cf2db246555deda8db395f2f0a7e786590 /logging.go | |
| parent | b4f45f7c654e87bda6d5e7effb6ac5b5feb29ce0 (diff) | |
config file refactor
Diffstat (limited to 'logging.go')
| -rw-r--r-- | logging.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/logging.go b/logging.go new file mode 100644 index 0000000..9221b24 --- /dev/null +++ b/logging.go @@ -0,0 +1,18 @@ +package main + +import ( + "sync" + + "github.com/go-kit/log/level" + "tildegit.org/tjp/sliderule/logging" +) + +var ( + once sync.Once + debug, info, warn, errlog logging.Logger +) + +func Loggers(config *Configuration) (logging.Logger, logging.Logger, logging.Logger, logging.Logger) { + base := level.NewFilter(logging.Base(), level.Allow(config.LogLevel)) + return level.Debug(base), level.Info(base), level.Warn(base), level.Error(base) +} |
