summaryrefslogtreecommitdiff
path: root/internal/io/dlog/loggers
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2021-10-02 11:23:08 +0300
committerPaul Buetow <paul@buetow.org>2021-10-02 12:26:36 +0300
commit6e1af993924bc7bebe898b403962db5a6b3505d1 (patch)
treee4f124dfc917bc96a669e8598400775b2ca5fc25 /internal/io/dlog/loggers
parent764ef99a3d779a0db1fb60679292af52425ba2f6 (diff)
Client default log dir is ~/log
Diffstat (limited to 'internal/io/dlog/loggers')
-rw-r--r--internal/io/dlog/loggers/strategy.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/internal/io/dlog/loggers/strategy.go b/internal/io/dlog/loggers/strategy.go
new file mode 100644
index 0000000..a1b9355
--- /dev/null
+++ b/internal/io/dlog/loggers/strategy.go
@@ -0,0 +1,27 @@
+package loggers
+
+import (
+ "os"
+ "path/filepath"
+)
+
+type Rotation int
+
+const (
+ DailyRotation Rotation = iota
+ SignalRotation Rotation = iota
+)
+
+type Strategy struct {
+ Rotation Rotation
+ FileBase string
+}
+
+func GetStrategy(name string) Strategy {
+ switch name {
+ case "daily":
+ return Strategy{DailyRotation, ""}
+ default:
+ return Strategy{SignalRotation, filepath.Base(os.Args[0])}
+ }
+}