diff options
| author | Paul Buetow <pbuetow@mimecast.com> | 2020-03-04 17:32:04 +0000 |
|---|---|---|
| committer | Paul Buetow <pbuetow@mimecast.com> | 2020-03-04 17:32:04 +0000 |
| commit | fc731d2b8f8db3885a0e4680d885b5936e6d50c1 (patch) | |
| tree | d10ada3d1fa08dabfb359fdf4a1ef49c6ce74b46 | |
| parent | 9314744d715b839b1708ca64fb6ca71438d8b440 (diff) | |
add missing files
| -rw-r--r-- | internal/io/logger/modes.go | 11 | ||||
| -rw-r--r-- | internal/io/logger/strategy.go | 22 |
2 files changed, 33 insertions, 0 deletions
diff --git a/internal/io/logger/modes.go b/internal/io/logger/modes.go new file mode 100644 index 0000000..0a985cd --- /dev/null +++ b/internal/io/logger/modes.go @@ -0,0 +1,11 @@ +package logger + +type Modes struct { + Server bool + Trace bool + Debug bool + Quiet bool + Nothing bool + logToStdout bool + logToFile bool +} diff --git a/internal/io/logger/strategy.go b/internal/io/logger/strategy.go new file mode 100644 index 0000000..5667812 --- /dev/null +++ b/internal/io/logger/strategy.go @@ -0,0 +1,22 @@ +package logger + +import "github.com/mimecast/dtail/internal/config" + +// strategy allows to specify a log rotation strategy. +type Strategy int + +// Possible log strategies. +const ( + NormalStrategy Strategy = iota + DailyStrategy Strategy = iota + StdoutStrategy Strategy = iota +) + +func logStrategy() Strategy { + switch config.Common.LogStrategy { + case "daily": + return DailyStrategy + default: + } + return StdoutStrategy +} |
