Documentation ¶
Overview ¶
Package gtbox_log Log工具
Index ¶
- Variables
- func GTGetLogsDir() string
- func LogDebugf(format string, args ...interface{})
- func LogErrorf(format string, args ...interface{})
- func LogF(style GTLogStyle, format string, args ...interface{})
- func LogFatalf(format string, args ...interface{})
- func LogInfof(format string, args ...interface{})
- func LogTracef(format string, args ...interface{})
- func LogWarnf(format string, args ...interface{})
- func SetupLogTools(productName string, enableSaveLogFile bool, settingLogLeve logrus.Level, ...)
- type GTLog
- func (aLog *GTLog) Debugf(format string, args ...interface{})
- func (aLog *GTLog) Errorf(format string, args ...interface{})
- func (aLog *GTLog) Fatalf(format string, args ...interface{})
- func (aLog *GTLog) Infof(format string, args ...interface{})
- func (alog *GTLog) Setup()
- func (aLog *GTLog) Tracef(format string, args ...interface{})
- func (aLog *GTLog) Warnf(format string, args ...interface{})
- type GTLogSaveType
- type GTLogStyle
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ALog *GTLog GTLogOnce sync.Once ProjectName = "test" LogLevel = logrus.DebugLevel LogSaveMaxDays int64 LogSaveFlag = GTLogSaveTypeDays LogPath = "./logs/run" EnableSaveLogFile = false // EnableSaveLogFile 开启日志文件存储 )
Functions ¶
func LogF ¶ added in v0.0.52
func LogF(style GTLogStyle, format string, args ...interface{})
LogF 快捷日志Function,含模块字段封装 Params [style] log类型 fatal、trace、info、warning、error、debug Params [format] 模块名称:自定义字符串 Params [args...] 模块名称:自定义字符串
func SetupLogTools ¶ added in v0.0.19
Types ¶
type GTLogSaveType ¶
type GTLogSaveType int
GTLogSaveType 日志分片类型
const ( GTLogSaveTypeDays GTLogSaveType = iota //按日分片 GTLogSaveHours //按小时分片 )
func (GTLogSaveType) String ¶
func (aFlag GTLogSaveType) String() string
type GTLogStyle ¶ added in v0.0.52
type GTLogStyle int
GTLogStyle 日志样式
const ( GTLogStyleDebug GTLogStyle = iota // Debug GTLogStyleError // Error GTLogStyleWarning // Warning GTLogStyleInfo // Info GTLogStyleTrace // Trace GTLogStyleFatal // Fatal )
func (GTLogStyle) String ¶ added in v0.0.52
func (aStyle GTLogStyle) String() string
Click to show internal directories.
Click to hide internal directories.