gtbox_log

package
v0.0.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2023 License: BSD-3-Clause Imports: 6 Imported by: 12

Documentation

Index

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"
	LogDebugToCut  = false //debug模式下是否开启日志分割	默认false方便IDE调试
)

Functions

func GTGetLogsDir

func GTGetLogsDir() string

GTGetLogsDir 获取Log目录

func LogDebugf

func LogDebugf(format string, args ...interface{})

LogDebugf format格式化log--debug信息

func LogErrorf

func LogErrorf(format string, args ...interface{})

LogErrorf format格式化log--error信息

func LogFatalf

func LogFatalf(format string, args ...interface{})

LogFatalf format格式化log--Fatal信息

func LogInfof

func LogInfof(format string, args ...interface{})

LogInfof format格式化log--info信息

func LogTracef

func LogTracef(format string, args ...interface{})

LogTracef format格式化log--Trace信息

func LogWarnf

func LogWarnf(format string, args ...interface{})

LogWarnf format格式化log--Warning信息

func Setup

func Setup(productName string, debugToCut bool, settingLogLeve logrus.Level, logMaxSaveDays int64, logSaveType GTLogSaveType)

Types

type GTLog

type GTLog struct {
	// contains filtered or unexported fields
}

func Instance

func Instance() *GTLog

func (*GTLog) Debugf

func (aLog *GTLog) Debugf(format string, args ...interface{})

func (*GTLog) Errorf

func (aLog *GTLog) Errorf(format string, args ...interface{})

func (*GTLog) Fatalf

func (aLog *GTLog) Fatalf(format string, args ...interface{})

func (*GTLog) Ininfof

func (aLog *GTLog) Ininfof(format string, args ...interface{})

func (*GTLog) Setup

func (alog *GTLog) Setup()

func (*GTLog) Tracef

func (aLog *GTLog) Tracef(format string, args ...interface{})

func (*GTLog) Warnf

func (aLog *GTLog) Warnf(format string, args ...interface{})

type GTLogSaveType

type GTLogSaveType int

GTLogSaveType 日志分片类型

const (
	GTLogSaveTypeDays GTLogSaveType = iota //按日分片
	GTLogSaveHours                         //按小时分片
)

func (GTLogSaveType) String

func (aFlag GTLogSaveType) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL