Thanks to visit codestin.com
Credit goes to pkg.go.dev

logging

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultLogger

type DefaultLogger struct {
	Level    LogLevel
	GoLogger *log.Logger
	Offset   int
}

DefaultLogger is a simple logger that uses the standard log package.

func NewDefaultLogger

func NewDefaultLogger(level LogLevel, offset int) *DefaultLogger

func (*DefaultLogger) Debug

func (l *DefaultLogger) Debug(format string, v ...interface{})

func (*DefaultLogger) Error

func (l *DefaultLogger) Error(format string, v ...interface{})

func (*DefaultLogger) Info

func (l *DefaultLogger) Info(format string, v ...interface{})

func (*DefaultLogger) Log

func (l *DefaultLogger) Log(level LogLevel, format string, v ...interface{})

func (*DefaultLogger) Trace

func (l *DefaultLogger) Trace(format string, v ...interface{})

func (*DefaultLogger) Warn

func (l *DefaultLogger) Warn(format string, v ...interface{})

type LogLevel

type LogLevel int

LogLevel specifies the severity of a log message.

const (
	LogError LogLevel = iota
	LogWarn
	LogInfo
	LogDebug
	LogTrace
)

Various logging levels (or subsystems) which can categorize the message. Currently these are ordered in decreasing severity.

type Logger

type Logger interface {
	// Error outputs an error level log message.
	Error(format string, v ...interface{})

	// Warn outputs an warn level log message.
	Warn(format string, v ...interface{})

	// Info outputs an info level log message.
	Info(format string, v ...interface{})

	// Debug outputs a debug level error log message.
	Debug(format string, v ...interface{})

	// Trace outputs a trace level error log message.
	Trace(format string, v ...interface{})
}

Logger defines a logging interface.

Jump to

Keyboard shortcuts

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