1 Star 0 Fork 0

monobytes/gcore

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
def.go 926 Bytes
一键复制 编辑 原始数据 按行查看 历史
null 提交于 2025-01-22 18:29 +08:00 . first commit
package glog
// Format 日志输出格式
type Format int
const (
TextFormat Format = iota // 文本格式
JsonFormat // JSON格式
)
func (f Format) String() string {
switch f {
case TextFormat:
return "text"
case JsonFormat:
return "json"
}
return "none"
}
// CutRule 日志切割规则
type CutRule int
const (
CutByYear CutRule = iota + 1 // 按照年切割
CutByMonth // 按照月切割
CutByDay // 按照日切割
CutByHour // 按照时切割
CutByMinute // 按照分切割
CutBySecond // 按照秒切割
)
func (c CutRule) String() string {
switch c {
case CutByYear:
return "year"
case CutByMonth:
return "month"
case CutByDay:
return "day"
case CutByHour:
return "hour"
case CutByMinute:
return "minute"
case CutBySecond:
return "second"
}
return "none"
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/monobytes/gcore.git
git@gitee.com:monobytes/gcore.git
monobytes
gcore
gcore
v1.0.3

搜索帮助