diff options
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) +} |
