summaryrefslogtreecommitdiff
path: root/internal/io/dlog/loggers/factory.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2021-09-28 21:11:50 +0300
committerPaul Buetow <paul@buetow.org>2021-10-02 12:26:36 +0300
commit609921f9c783941eaa9019a92b78ec45b49d681c (patch)
treec4fc6b20404d0f922dc2825e4624be8c04479cbf /internal/io/dlog/loggers/factory.go
parentfcaa94c7453efa0d74e330128c0f5c2cde8f11b3 (diff)
can have daily and normal file log rotation
Diffstat (limited to 'internal/io/dlog/loggers/factory.go')
-rw-r--r--internal/io/dlog/loggers/factory.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/io/dlog/loggers/factory.go b/internal/io/dlog/loggers/factory.go
index 3eb29c5..8697dc4 100644
--- a/internal/io/dlog/loggers/factory.go
+++ b/internal/io/dlog/loggers/factory.go
@@ -17,11 +17,11 @@ const (
var factoryMap map[string]Logger
var factoryMutex sync.Mutex
-func Factory(name string, impl Impl) Logger {
+func Factory(name string, impl Impl, strategy Strategy) Logger {
factoryMutex.Lock()
defer factoryMutex.Unlock()
- id := fmt.Sprintf("name:%s,impl:%v", name, impl)
+ id := fmt.Sprintf("name:%s,fileBase:%s,impl:%v", name, strategy.FileBase, impl)
if factoryMap == nil {
factoryMap = make(map[string]Logger)
@@ -36,10 +36,10 @@ func Factory(name string, impl Impl) Logger {
singleton = newStdout()
factoryMap[id] = singleton
case FILE:
- singleton = newFile()
+ singleton = newFile(strategy)
factoryMap[id] = singleton
case FOUT:
- singleton = newFout()
+ singleton = newFout(strategy)
factoryMap[id] = singleton
}
}