gg_log

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: BSD-3-Clause Imports: 7 Imported by: 26

Documentation

Index

Constants

View Source
const (
	DateFormatStandard = "yyyy-MM-dd HH:mm:ss"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ILogger

type ILogger interface {
	gg_.ILogger
}

type Level

type Level uint32

Level type

const (
	// PanicLevel level, highest level of severity. Logs and then calls panic with the
	// message passed to Debug, Info, ...
	PanicLevel Level = iota
	// ErrorLevel level. Logs. Used for errors that should definitely be noted.
	// Commonly used for hooks to send errors to an error tracking service.
	ErrorLevel
	// WarnLevel level. Non-critical entries that deserve eyes.
	WarnLevel
	// InfoLevel level. General operational entries about what's going on inside the
	// application.
	InfoLevel
	// DebugLevel level. Usually only enabled when debugging. Very verbose logging.
	DebugLevel
	// TraceLevel level. Designates finer-grained informational events than the Debug.
	TraceLevel
)

func ParseLevel

func ParseLevel(lvl string) (Level, error)

func (Level) MarshalText

func (level Level) MarshalText() ([]byte, error)

func (Level) String

func (level Level) String() string

func (*Level) UnmarshalText

func (level *Level) UnmarshalText(text []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

type LogHelper

type LogHelper struct {
}
var Log *LogHelper

func (*LogHelper) Logger

func (instance *LogHelper) Logger() *Logger

func (*LogHelper) New

func (instance *LogHelper) New(level, filename string) ILogger

func (*LogHelper) NewEmpty

func (instance *LogHelper) NewEmpty() *Logger

func (*LogHelper) NewNoRotate

func (instance *LogHelper) NewNoRotate(level, filename string) ILogger

type Logger

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

func NewLogger

func NewLogger() *Logger

func (*Logger) Close

func (instance *Logger) Close()

func (*Logger) Debug

func (instance *Logger) Debug(args ...interface{})

func (*Logger) Debugf

func (instance *Logger) Debugf(message string, args ...interface{})

func (*Logger) Error

func (instance *Logger) Error(args ...interface{})

func (*Logger) Errorf

func (instance *Logger) Errorf(message string, args ...interface{})

func (*Logger) Flush

func (instance *Logger) Flush()

func (*Logger) GetDateFormat

func (instance *Logger) GetDateFormat() (response string)

func (*Logger) GetFilename

func (instance *Logger) GetFilename() string

func (*Logger) GetLevel

func (instance *Logger) GetLevel() Level

func (*Logger) GetMessageFormat

func (instance *Logger) GetMessageFormat() (response string)

func (*Logger) HasRotatedBeforeLastWrite added in v0.2.92

func (instance *Logger) HasRotatedBeforeLastWrite() bool

func (*Logger) Info

func (instance *Logger) Info(args ...interface{})

func (*Logger) Infof

func (instance *Logger) Infof(message string, args ...interface{})

func (*Logger) Join added in v0.2.94

func (instance *Logger) Join()

func (*Logger) LastRotationTime added in v0.2.92

func (instance *Logger) LastRotationTime() time.Time

func (*Logger) OutConsole

func (instance *Logger) OutConsole(value bool) *Logger

func (*Logger) OutFile

func (instance *Logger) OutFile(value bool) *Logger

func (*Logger) Panic

func (instance *Logger) Panic(args ...interface{})

func (*Logger) Panicf

func (instance *Logger) Panicf(message string, args ...interface{})

func (*Logger) Rotate added in v0.2.89

func (instance *Logger) Rotate() (err error)

Rotate force file rotation

func (*Logger) RotateEnable

func (instance *Logger) RotateEnable(value bool) *Logger

func (*Logger) RotateMaxSizeMb

func (instance *Logger) RotateMaxSizeMb(value float64) *Logger

func (*Logger) SetDateFormat

func (instance *Logger) SetDateFormat(format string) *Logger

func (*Logger) SetFilename

func (instance *Logger) SetFilename(filename string) *Logger

func (*Logger) SetLevel

func (instance *Logger) SetLevel(v interface{}) *Logger

func (*Logger) SetMessageFormat

func (instance *Logger) SetMessageFormat(format string) *Logger

func (*Logger) String

func (instance *Logger) String() string

func (*Logger) Trace

func (instance *Logger) Trace(args ...interface{})

func (*Logger) Tracef

func (instance *Logger) Tracef(message string, args ...interface{})

func (*Logger) Warn

func (instance *Logger) Warn(args ...interface{})

func (*Logger) Warnf

func (instance *Logger) Warnf(message string, args ...interface{})

Jump to

Keyboard shortcuts

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