建议把 handler.rotateTime 弄成public
worldyuan opened this issue · 2 comments
worldyuan commented
System (please complete the following information):
- OS:
linux
[e.g. linux, macOS] - GO Version:
1.13
[e.g.1.13
] - Pkg Version:
1.1.1
[e.g.1.1.1
]
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
func RotateMap() map[string]uint8 {
return map[string]uint8{
"day": handler.EveryDay,
"hour": 1,
"60m": 1,
"30m": 2,
"15m": 3,
"m": 4,
}
}
handler.NewRotateFileHandler(c.Path, RotateMap()[config])
Expected behavior
func RotateMap() map[string]rotateTime {
return map[string]rotateTime{
"day": handler.EveryDay,
"hour": 1,
"60m": 1,
"30m": 2,
"15m": 3,
"m": 4,
}
}
handler.NewRotateFileHandler(c.Path, RotateMap()[config])
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
我通过配置文件配置多久创建一次日志,但是没办法做成map,很不便利。
inhere commented
ok 最近正在重构这块逻辑。
inhere commented
hi @jeek120 已经在 https://github.com/gookit/slog/releases/tag/v0.3.0 调整了。
编写了新的文档:
https://github.com/gookit/slog/blob/master/README.zh-CN.md