log

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: Unlicense Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const DayLevel = "day"
View Source
const DebugLevel = "debug"

debug

View Source
const ErrorLevel = "error"

error

View Source
const InfoLevel = "info"

info

View Source
const MonthsLevel = "months"
View Source
const WarnLevel = "warn"

warn

View Source
const YearLevel = "Year"

Variables

View Source
var LogConsoleLevel = "debug"

控制台输出等级

View Source
var LogDebugColor = "cyan"

debug 颜色

View Source
var LogDebugFile = "debug.log"

debug 存储文件名称

View Source
var LogErrorColor = "red"

error 颜色

View Source
var LogErrorFile = "error.log"

error 存储文件名称

View Source
var LogInfoColor = "blue"

info 颜色

View Source
var LogInfoFile = "info.log"

info 存储文件名称

View Source
var LogIsSave = true

是否保存日志

View Source
var LogMsgNum = 1024

日志数量

View Source
var LogSaveCutMax = 30

日志最长保存时间

View Source
var LogSaveCutTime = "day"

保存分段 (年,月,日)

View Source
var LogSaveIsCut = true

保存分段 (年,月,日)

View Source
var LogSavePath = "logs"

日志存储地址

View Source
var LogTimeFormat = "2001-05-16 15:04:05 500"

是否保存日志

View Source
var LogWarnColor = "yellow"

warn 颜色

View Source
var LogWarnFile = "warn.log"

warn 存储文件名称

Functions

func CreateLogMsg

func CreateLogMsg(logLevel string, contents string)

func Debug

func Debug(in ...interface{})

func Error

func Error(in ...interface{})

func Info

func Info(in ...interface{})

func Start

func Start()

func Stop

func Stop()

func Warn

func Warn(in ...interface{})

Types

type LogMsg

type LogMsg struct {
	LogLevel string
	Time     time.Time
	Contents string
	FuncInfo string
}

type LogStart

type LogStart struct {
	IsSave      bool   `autoInjectCfg:"octopus.log.save.is"`
	SavePath    string `autoInjectCfg:"octopus.log.save.path"`
	SaveIsCut   bool   `autoInjectCfg:"octopus.log.save.cut.is"`
	SaveCutTime string `autoInjectCfg:"octopus.log.save.cut.time"`
	SaveCutMax  int    `autoInjectCfg:"octopus.log.save.cut.max"`

	ConsoleLevel string `autoInjectCfg:"octopus.log.console.level"`

	TimeFormat string `autoInjectCfg:"octopus.log.time.format"`

	MsgNum int `autoInjectCfg:"octopus.log.msg.num"`

	DebugColor string `autoInjectCfg:"octopus.log.debug.color"`
	DebugFile  string `autoInjectCfg:"octopus.log.debug.file"`

	InfoColor string `autoInjectCfg:"octopus.log.info.color"`
	InfoFile  string `autoInjectCfg:"octopus.log.info.file"`

	WarnColor string `autoInjectCfg:"octopus.log.warn.color"`
	WarnFile  string `autoInjectCfg:"octopus.log.warn.file"`

	ErrorColor string `autoInjectCfg:"octopus.log.error.color"`
	ErrorFile  string `autoInjectCfg:"octopus.log.error.file"`
}

Log启动方法

func (*LogStart) Start

func (l *LogStart) Start()

func (*LogStart) Stop

func (l *LogStart) Stop()

type LogStop

type LogStop struct {
}

Log停止方法

type OctopusLog

type OctopusLog struct {
	LogMsgChan chan *LogMsg
}

Jump to

Keyboard shortcuts

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