logger

package
v0.0.0-...-5b3aa3e Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LevelNone = iota
	LevelInfo
	LevelWarning
	LevelError
	LevelVerbose
	LevelDebug
)

Variables

View Source
var (
	DefaultLevel = 3
)

Functions

func Debug

func Debug(message string) error

func Debugf

func Debugf(message ...any) error

func Error

func Error(message string) error

func ErrorPrintf

func ErrorPrintf(message ...any) error

Print error as a warning, return error for function calling

func Errorf

func Errorf(message ...any) error

func Info

func Info(message string) error

And without!

func Infof

func Infof(message ...any) error

Logging functions with formatting

func SetLevel

func SetLevel(level int)

SetLevel sets the global logging level

func Verbose

func Verbose(message string) error

func Verbosef

func Verbosef(message ...any) error

func Warning

func Warning(message string) error

func Warningf

func Warningf(message ...any) error

func WriteToFile

func WriteToFile(filename string)

WriteToFile will set the global level and filename

Types

type RainbowLogger

type RainbowLogger struct {
	Filename string
	// contains filtered or unexported fields
}

func (*RainbowLogger) Start

func (l *RainbowLogger) Start() (*log.Logger, error)

Start opens a file handle, if it's desired to write to file

func (*RainbowLogger) Stop

func (l *RainbowLogger) Stop() error

Stop closes the file handle, if defined

Jump to

Keyboard shortcuts

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