dbg

package
v0.0.0-...-cb352a8 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 13 Imported by: 12

Documentation

Index

Constants

View Source
const (
	ColorRed    = 91
	ColorGreen  = 92
	ColorYellow = 93

	ColorRedBack    = 41
	ColorGreenBack  = 42
	ColorYellowBack = 43
)
View Source
const (
	CSDefault = 0
	CSConsole = 0x1
	CSLog     = 0x2
	CSInfo    = 0x04
	CSError   = 0x08
	CSWarning = 0x10
	CSAll     = 0xFFFF
)

Variables

View Source
var LogFileDir = "log"

Functions

func BytesToString

func BytesToString(b []byte) string

func Dbg

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

func DbgMode

func DbgMode(mode int, format string, args ...interface{})

func DbgModeRaw

func DbgModeRaw(addMode int, format string, args ...interface{})

func DbgRaw

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

func Enable

func Enable(v bool)

func EnableQueue

func EnableQueue(enable bool, max int)

func GetQueueString

func GetQueueString() (bool, string)

func IsEnableQueue

func IsEnableQueue() bool

func SetDayMultiLog

func SetDayMultiLog(v bool)

func SetDefaultMode

func SetDefaultMode(mode int)

func SetFormat

func SetFormat(format string)

SetFormat L: line C: function name P: package name F: full Filename f: short filename "P.C:F:L>"

func SetHook

func SetHook(f func(data []byte) bool)

func SetLogFile

func SetLogFile(filepath string, filename string, prefix string)

func SetLogFileSize

func SetLogFileSize(size int)

func SetLogFlags

func SetLogFlags(flags int)

func SetLogPathDepth

func SetLogPathDepth(level int)

func SetLogReset

func SetLogReset()

func SetLogRollback

func SetLogRollback(v bool)

func SetMaxLog

func SetMaxLog(count int)

func StringToBytes

func StringToBytes(s string) []byte

func Wait

func Wait(ms int)

Types

type Debug

type Debug struct {
	LogFile *LogFile
	// contains filtered or unexported fields
}

func NewDbg

func NewDbg(mode int) *Debug

func (*Debug) Dbg

func (me *Debug) Dbg(format string, args ...interface{})

func (*Debug) DbgMode

func (me *Debug) DbgMode(mode int, format string, args ...interface{})

func (*Debug) DbgRaw

func (me *Debug) DbgRaw(mode int, format string, args ...interface{})

func (*Debug) GetLogString

func (me *Debug) GetLogString() (bool, string)

func (*Debug) SetDefaultMode

func (me *Debug) SetDefaultMode(mode int)

func (*Debug) SetEnableQueue

func (me *Debug) SetEnableQueue(enable bool, max int)

func (*Debug) SetLogFile

func (me *Debug) SetLogFile(filepath string, filename string, prefix string)

func (*Debug) Wait

func (me *Debug) Wait(ms int)

type LogFile

type LogFile struct {
	// contains filtered or unexported fields
}
var Log *LogFile

func CreateLogFile

func CreateLogFile(filepath, prefix string) *LogFile

func (*LogFile) CheckLogFile

func (me *LogFile) CheckLogFile()

func (*LogFile) GetFilename

func (me *LogFile) GetFilename() (string, string)

func (*LogFile) Log

func (me *LogFile) Log(debugInfo, format string, args ...interface{})

func (*LogFile) SetDayMulti

func (me *LogFile) SetDayMulti(v bool)

func (*LogFile) SetFilePath

func (me *LogFile) SetFilePath(filepath string, filename string, prefix string)

func (*LogFile) SetMaxFilesize

func (me *LogFile) SetMaxFilesize(s int)

func (*LogFile) SetMaxLog

func (me *LogFile) SetMaxLog(days int)

func (*LogFile) SetReset

func (me *LogFile) SetReset(v bool)

func (*LogFile) SetRollbackMode

func (me *LogFile) SetRollbackMode(v bool)

func (*LogFile) Start

func (me *LogFile) Start()

type LogStringSlice

type LogStringSlice []string

func (LogStringSlice) Len

func (c LogStringSlice) Len() int

func (LogStringSlice) Less

func (c LogStringSlice) Less(i, j int) bool

func (LogStringSlice) Swap

func (c LogStringSlice) Swap(i, j int)

type Queue

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

func NewQueue

func NewQueue(maxSize int) *Queue

func (*Queue) GetNoWait

func (me *Queue) GetNoWait() (interface{}, error)

func (*Queue) PutNoWait

func (me *Queue) PutNoWait(d interface{}) error

func (*Queue) Size

func (me *Queue) Size() int

Jump to

Keyboard shortcuts

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