v0.2.53 Latest Latest

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

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




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


This section is empty.


This section is empty.


type ILogger

type ILogger interface {

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.
	// WarnLevel level. Non-critical entries that deserve eyes.
	// InfoLevel level. General operational entries about what's going on inside the
	// application.
	// DebugLevel level. Usually only enabled when debugging. Very verbose logging.
	// TraceLevel level. Designates finer-grained informational events than the Debug.

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) Info

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

func (*Logger) Infof

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

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) 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