log

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Log

func Log(logLevel LogLevel, args ...interface{})

Log is called internally by the library to log messages

func Logf

func Logf(logLevel LogLevel, format string, args ...interface{})

Logf is called internally by the library to log messages

func SetLogger

func SetLogger(l Logger)

SetLogger sets the logger to be used by the package

Types

type LogLevel

type LogLevel uint8

LogLevel is the log LogLevel

const (
	Debug LogLevel = iota
	Info
	Warn
	Error
	Fatal
	Panic
)

You can use the following LogLevels in your implementation: 0: Debug 1: Info 2: Warn 3: Error 4: Fatal 5: Panic

func ParseLogLevel

func ParseLogLevel(logLevel string) (LogLevel, error)

ParseLogLevel parses a string into a LogLevel

type Logger

type Logger interface {
	// Log logs a message at the given LogLevel. Arguments are handled in the manner of fmt.Print.
	Log(logLevel LogLevel, args ...interface{})
	// Logf logs a message at the given LogLevel. Arguments are handled in the manner of fmt.Printf.
	Logf(logLevel LogLevel, format string, args ...interface{})
}

Logger is the interface that wraps the Log and Logf methods.

Jump to

Keyboard shortcuts

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