logger

package
v2.7.2 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: MIT Imports: 4 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{}

DefaultLogger is a utility to log messages to a number of destinations

func (*DefaultLogger) Debug

func (l *DefaultLogger) Debug(message string)

Debug level logging. Works like Sprintf.

func (*DefaultLogger) Error

func (l *DefaultLogger) Error(message string)

Error level logging. Works like Sprintf.

func (*DefaultLogger) Fatal

func (l *DefaultLogger) Fatal(message string)

Fatal level logging. Works like Sprintf.

func (*DefaultLogger) Info

func (l *DefaultLogger) Info(message string)

Info level logging. Works like Sprintf.

func (*DefaultLogger) Print

func (l *DefaultLogger) Print(message string)

Print works like Sprintf.

func (*DefaultLogger) Trace

func (l *DefaultLogger) Trace(message string)

Trace level logging. Works like Sprintf.

func (*DefaultLogger) Warning

func (l *DefaultLogger) Warning(message string)

Warning level logging. Works like Sprintf.

type FileLogger

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

FileLogger is a utility to log messages to a number of destinations

func (*FileLogger) Debug

func (l *FileLogger) Debug(message string)

Debug level logging. Works like Sprintf.

func (*FileLogger) Error

func (l *FileLogger) Error(message string)

Error level logging. Works like Sprintf.

func (*FileLogger) Fatal

func (l *FileLogger) Fatal(message string)

Fatal level logging. Works like Sprintf.

func (*FileLogger) Info

func (l *FileLogger) Info(message string)

Info level logging. Works like Sprintf.

func (*FileLogger) Print

func (l *FileLogger) Print(message string)

Print works like Sprintf.

func (*FileLogger) Println

func (l *FileLogger) Println(message string)

func (*FileLogger) Trace

func (l *FileLogger) Trace(message string)

Trace level logging. Works like Sprintf.

func (*FileLogger) Warning

func (l *FileLogger) Warning(message string)

Warning level logging. Works like Sprintf.

type LogLevel

type LogLevel uint8

LogLevel is an unsigned 8bit int

const (
	// TRACE level
	TRACE LogLevel = 1

	// DEBUG level logging
	DEBUG LogLevel = 2

	// INFO level logging
	INFO LogLevel = 3

	// WARNING level logging
	WARNING LogLevel = 4

	// ERROR level logging
	ERROR LogLevel = 5
)

func StringToLogLevel

func StringToLogLevel(input string) (LogLevel, error)

type Logger

type Logger interface {
	Print(message string)
	Trace(message string)
	Debug(message string)
	Info(message string)
	Warning(message string)
	Error(message string)
	Fatal(message string)
}

Logger specifies the methods required to attach a logger to a Wails application

func NewDefaultLogger

func NewDefaultLogger() Logger

NewDefaultLogger creates a new Logger.

func NewFileLogger

func NewFileLogger(filename string) Logger

NewFileLogger creates a new Logger.

Jump to

Keyboard shortcuts

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