log

package
v1.0.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Console = &Logger{
	File:     os.Stdout,
	LogLevel: Info,
	Buffer:   make([]byte, 4096),
	Len:      4096,
	Color:    true,
}

Functions

This section is empty.

Types

type Log

type Log struct {
	LogLevel LogLevel
	LogInfo  string
}

type LogLevel

type LogLevel int
const (
	Debug LogLevel = 1
	Info  LogLevel = 2
	Warn  LogLevel = 3
	Error LogLevel = 4
	Panic LogLevel = 5
)

type Logger

type Logger struct {
	File     *os.File
	LogLevel LogLevel
	Buffer   []byte
	Len      uint32
	Pos      uint32
	Color    bool
	// contains filtered or unexported fields
}

Logger writes leveled, buffered entries to a file. Safe for concurrent use; do not copy it after first use.

func NewLogger added in v1.1.1

func NewLogger(file string, bufferLen uint32) *Logger

NewLogger opens file for appending. It panics if the file cannot be opened.

func (*Logger) Debug

func (l *Logger) Debug(info string)

func (*Logger) Error

func (l *Logger) Error(info string)

func (*Logger) Fatal

func (l *Logger) Fatal(info string)

func (*Logger) Flush

func (l *Logger) Flush()

func (*Logger) Info

func (l *Logger) Info(info string)

func (*Logger) Panic

func (l *Logger) Panic(info string)

func (*Logger) Warn

func (l *Logger) Warn(info string)

Jump to

Keyboard shortcuts

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