logger

package
v2.0.0-alpha.72 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomLogger

type CustomLogger interface {
	// Writeln writes directly to the output with no log level plus line ending
	Writeln(message string)

	// Write writes directly to the output with no log level
	Write(message string)

	// Trace level logging. Works like Sprintf.
	Trace(format string, args ...interface{})

	// Debug level logging. Works like Sprintf.
	Debug(format string, args ...interface{})

	// Info level logging. Works like Sprintf.
	Info(format string, args ...interface{})

	// Warning level logging. Works like Sprintf.
	Warning(format string, args ...interface{})

	// Error level logging. Works like Sprintf.
	Error(format string, args ...interface{})

	// Fatal level logging. Works like Sprintf.
	Fatal(format string, args ...interface{})
}

CustomLogger defines what a user can do with a logger

type LogLevel

type LogLevel = logger.LogLevel

LogLevel is an alias for the public LogLevel

type Logger

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

Logger is a utlility to log messages to a number of destinations

func New

func New(output logger.Logger) *Logger

New creates a new Logger. You may pass in a number of `io.Writer`s that are the targets for the logs

func (*Logger) CustomLogger

func (l *Logger) CustomLogger(name string) CustomLogger

CustomLogger creates a new custom logger that prints out a name/id before the messages

func (*Logger) Debug

func (l *Logger) Debug(format string, args ...interface{})

Debug level logging. Works like Sprintf.

func (*Logger) Error

func (l *Logger) Error(format string, args ...interface{})

Error level logging. Works like Sprintf.

func (*Logger) Fatal

func (l *Logger) Fatal(format string, args ...interface{})

Fatal level logging. Works like Sprintf.

func (*Logger) HideLogLevel

func (l *Logger) HideLogLevel()

HideLogLevel removes the loglevel text from the start of each logged line

func (*Logger) Info

func (l *Logger) Info(format string, args ...interface{})

Info level logging. Works like Sprintf.

func (*Logger) Print

func (l *Logger) Print(message string)

Print writes directly to the output with no log level Appends a carriage return to the message

func (*Logger) SetLogLevel

func (l *Logger) SetLogLevel(level LogLevel)

SetLogLevel sets the minimum level of logs that will be output

func (*Logger) Trace

func (l *Logger) Trace(format string, args ...interface{})

Trace level logging. Works like Sprintf.

func (*Logger) Warning

func (l *Logger) Warning(format string, args ...interface{})

Warning level logging. Works like Sprintf.

func (*Logger) Write

func (l *Logger) Write(message string)

Write writes directly to the output with no log level

func (*Logger) Writeln

func (l *Logger) Writeln(message string)

Writeln writes directly to the output with no log level Appends a carriage return to the message

Jump to

Keyboard shortcuts

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