-
Notifications
You must be signed in to change notification settings - Fork 2
/
config.go
36 lines (31 loc) · 1.25 KB
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package zap
import "github.com/americanas-go/config"
const (
root = "ignite.zap"
consoleRoot = root + ".console"
consoleEnabled = consoleRoot + ".enabled"
consoleFormatter = consoleRoot + ".formatter"
consoleLevel = consoleRoot + ".level"
fileRoot = root + ".file"
fileEnabled = fileRoot + ".enabled"
fileLevel = fileRoot + ".level"
filePath = fileRoot + ".path"
fileName = fileRoot + ".name"
fileMaxSize = fileRoot + ".maxsize"
fileCompress = fileRoot + ".compress"
fileMaxAge = fileRoot + ".maxage"
fileFormatter = fileRoot + ".formatter"
)
func init() {
config.Add(consoleEnabled, true, "enable/disable console logging")
config.Add(consoleLevel, "INFO", "console log level")
config.Add(consoleFormatter, "TEXT", "formatter TEXT/JSON")
config.Add(fileEnabled, false, "enable/disable file logging")
config.Add(fileLevel, "INFO", "console log level")
config.Add(filePath, "/tmp", "log path")
config.Add(fileName, "application.log", "log filename")
config.Add(fileMaxSize, 100, "log file max size (MB)")
config.Add(fileCompress, true, "log file compress")
config.Add(fileMaxAge, 28, "log file max age (days)")
config.Add(fileFormatter, "TEXT", "formatter TEXT/JSON")
}