logger

package module
v0.0.0-...-8882c13 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: MIT Imports: 13 Imported by: 0

README

logger

Documentation

Index

Constants

View Source
const (
	DebugLevel   = 0
	ReleaseLevel = 1
	WarningLevel = 2
	ErrorLevel   = 3
	StackLevel   = 4
	FatalLevel   = 5
)

levels

Variables

View Source
var OpenConsole bool = true

Functions

func Close

func Close()

func Debug

func Debug(format string, a ...interface{})

func Error

func Error(format string, a ...interface{})

func Export

func Export(logger *Logger)

It's dangerous to call the method on logging

func Fatal

func Fatal(format string, a ...interface{})

func Release

func Release(format string, a ...interface{})

func SDebug

func SDebug(a ...interface{})

func SError

func SError(a ...interface{})

func SFatal

func SFatal(a ...interface{})

func SRelease

func SRelease(a ...interface{})

func SStack

func SStack(a ...interface{})

func SWarning

func SWarning(a ...interface{})

func SetLogLevel

func SetLogLevel(lv int)

func SetLogPath

func SetLogPath(path string, filePrefix string, showConsole bool)

func Stack

func Stack(format string, a ...interface{})

func Warning

func Warning(format string, a ...interface{})

Types

type Buffer

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

func (*Buffer) AppendBool

func (b *Buffer) AppendBool(v bool)

AppendBool appends a bool to the underlying buffer.

func (*Buffer) AppendByte

func (b *Buffer) AppendByte(v byte)

AppendByte writes a single byte to the Buffer.

func (*Buffer) AppendBytes

func (b *Buffer) AppendBytes(v []byte)

func (*Buffer) AppendFloat

func (b *Buffer) AppendFloat(f float64, bitSize int)

AppendFloat appends a float to the underlying buffer. It doesn't quote NaN or +/- Inf.

func (*Buffer) AppendInt

func (b *Buffer) AppendInt(i int64)

AppendInt appends an integer to the underlying buffer (assuming base 10).

func (*Buffer) AppendString

func (b *Buffer) AppendString(s string)

AppendString writes a string to the Buffer.

func (*Buffer) AppendUint

func (b *Buffer) AppendUint(i uint64)

AppendUint appends an unsigned integer to the underlying buffer (assuming base 10).

func (*Buffer) Bytes

func (b *Buffer) Bytes() []byte

Bytes returns a mutable reference to the underlying byte slice.

func (*Buffer) Cap

func (b *Buffer) Cap() int

Cap returns the capacity of the underlying byte slice.

func (*Buffer) Init

func (buff *Buffer) Init()

func (*Buffer) Len

func (b *Buffer) Len() int

Len returns the length of the underlying byte slice.

func (*Buffer) Locker

func (buff *Buffer) Locker()

func (*Buffer) Reset

func (b *Buffer) Reset()

Reset resets the underlying byte slice. Subsequent writes re-use the slice's backing array.

func (*Buffer) String

func (b *Buffer) String() string

String returns a string copy of the underlying byte slice.

func (*Buffer) TrimNewline

func (b *Buffer) TrimNewline()

TrimNewline trims any final "\n" byte from the end of the buffer.

func (*Buffer) UnLocker

func (buff *Buffer) UnLocker()

func (*Buffer) Write

func (b *Buffer) Write(bs []byte) (int, error)

Write implements io.Writer.

type Logger

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

func GetLogger

func GetLogger() *Logger

func New

func New(strLevel string, pathName string, filePre string, buffNum uint32) (*Logger, error)

func (*Logger) Close

func (logger *Logger) Close()

It's dangerous to call the method on logging

func (*Logger) Debug

func (logger *Logger) Debug(format string, a ...interface{})

func (*Logger) Error

func (logger *Logger) Error(format string, a ...interface{})

func (*Logger) Fatal

func (logger *Logger) Fatal(format string, a ...interface{})

func (*Logger) GenDayFile

func (logger *Logger) GenDayFile(now *time.Time) error

func (*Logger) Release

func (logger *Logger) Release(format string, a ...interface{})

func (*Logger) Stack

func (logger *Logger) Stack(format string, a ...interface{})

func (*Logger) Warning

func (logger *Logger) Warning(format string, a ...interface{})

Jump to

Keyboard shortcuts

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