gtbox_log

package
v0.1.103 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: BSD-3-Clause Imports: 10 Imported by: 12

Documentation

Overview

Package gtbox_log Log工具

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetProductMainLogDir added in v0.1.55

func GetProductMainLogDir() string

func GetProjectName added in v0.1.43

func GetProjectName() string

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 SetupLogTools added in v0.0.19

func SetupLogTools(productName string, enableSaveLogFile bool, logLeve GTLogStyle, logMaxSaveDays int64, logSaveType GTLogSaveType, productLogDir string)

SetupLogTools 初始化日志

Types

type GTLog

type GTLog struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewGTLog added in v0.1.55

func NewGTLog(modelName string) *GTLog

NewGTLog 添加GTLog模块

func (*GTLog) LogDebugf added in v0.1.55

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

LogDebugf format格式化log--debug信息

func (*GTLog) LogErrorf added in v0.1.55

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

LogErrorf format格式化log--error信息

func (*GTLog) LogFatalf added in v0.1.55

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

LogFatalf format格式化log--Fatal信息 !!!慎用,使用后程序会退出!!!

func (*GTLog) LogInfof added in v0.1.55

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

LogInfof format格式化log--info信息

func (*GTLog) LogTracef added in v0.1.55

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

LogTracef format格式化log--Trace信息

func (*GTLog) LogWarnf added in v0.1.55

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

LogWarnf format格式化log--Warning信息

type GTLogConf added in v0.1.55

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

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
	GTLogStylePanic                     // Panic
)

func GetLogLevel added in v0.1.43

func GetLogLevel() GTLogStyle

func (GTLogStyle) String added in v0.0.52

func (aStyle GTLogStyle) String() string

Jump to

Keyboard shortcuts

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