From a6098084f7150df34edecf1519386bd28a527361 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 11 Oct 2021 17:42:37 +0300 Subject: Update JSON-schema to reflect all recent config file changes. --- internal/io/dlog/dlog.go | 4 ++-- internal/io/dlog/loggers/factory.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'internal/io/dlog') diff --git a/internal/io/dlog/dlog.go b/internal/io/dlog/dlog.go index da67585..5e0c3a1 100644 --- a/internal/io/dlog/dlog.go +++ b/internal/io/dlog/dlog.go @@ -82,12 +82,12 @@ func new(sourceProcess, sourcePackage source.Source) *DLog { if err != nil { panic(err) } - strategy := loggers.NewStrategy(config.Common.LogStrategy) + logRotation := loggers.NewStrategy(config.Common.LogRotation) loggerName := config.Common.Logger level := newLevel(config.Common.LogLevel) return &DLog{ - logger: loggers.Factory(sourceProcess.String(), loggerName, strategy), + logger: loggers.Factory(sourceProcess.String(), loggerName, logRotation), sourceProcess: sourceProcess, sourcePackage: sourcePackage, maxLevel: level, diff --git a/internal/io/dlog/loggers/factory.go b/internal/io/dlog/loggers/factory.go index 415d7fb..a5cc7cf 100644 --- a/internal/io/dlog/loggers/factory.go +++ b/internal/io/dlog/loggers/factory.go @@ -10,12 +10,12 @@ var factoryMap map[string]Logger var factoryMutex sync.Mutex // Factory is there to retrieve a logger based on various settings. -func Factory(sourceName, loggerName string, rotationStrategy Strategy) Logger { +func Factory(sourceName, loggerName string, logRotation Strategy) Logger { factoryMutex.Lock() defer factoryMutex.Unlock() id := fmt.Sprintf("sourceName:%s,fileBase:%s,loggerName:%s", sourceName, - rotationStrategy.FileBase, loggerName) + logRotation.FileBase, loggerName) if factoryMap == nil { factoryMap = make(map[string]Logger) } @@ -29,10 +29,10 @@ func Factory(sourceName, loggerName string, rotationStrategy Strategy) Logger { singleton = newStdout() factoryMap[id] = singleton case "file": - singleton = newFile(rotationStrategy) + singleton = newFile(logRotation) factoryMap[id] = singleton case "fout": - singleton = newFout(rotationStrategy) + singleton = newFout(logRotation) factoryMap[id] = singleton default: panic(fmt.Sprintf("Unsupported logger type '%s'", loggerName)) -- cgit v1.2.3