log

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GreenTick   = "\u2705"
	RedCross    = "\u274C"
	Warning     = "\u26a0\ufe0f"
	Information = "\u2139\ufe0f"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsoleLogger

type ConsoleLogger interface {
	Out(s string, args ...interface{})
	Success(s string, args ...interface{})
	Info(s string, args ...interface{})
	Warn(s string, args ...interface{})
}

ConsoleLogger defines an interface for logging to the console

func NewSimpleLogger

func NewSimpleLogger(out io.Writer) ConsoleLogger

NewSimpleLogger creates a new simple logger

func NewVerboseLogger

func NewVerboseLogger(out io.Writer) ConsoleLogger

NewVerboseLogger creates a new verbose logger

type SimpleLogger

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

SimpleLogger defines a logger that logs without any text decoration and only supports logging using standard output. Logging with any of the provided logging levels will simply be ignored

func (SimpleLogger) Info

func (l SimpleLogger) Info(s string, args ...interface{})

Info will not log anything

func (SimpleLogger) Out

func (l SimpleLogger) Out(s string, args ...interface{})

Out will log without any text decoration

func (SimpleLogger) Success

func (l SimpleLogger) Success(s string, args ...interface{})

Success will not log anything

func (SimpleLogger) Warn

func (l SimpleLogger) Warn(s string, args ...interface{})

Warn will not log anything

type VerboseLogger

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

VerboseLogger defines a logger that supports various different logging levels with text decoration. It is designed for logging out verbose information to aid the understanding of the application logic and shouldn't be used as the default logger for the application

func (VerboseLogger) Info

func (l VerboseLogger) Info(s string, args ...interface{})

Info will log with information text decoration and line ending

func (VerboseLogger) Out

func (l VerboseLogger) Out(s string, args ...interface{})

Out will log without any text decoration and line ending

func (VerboseLogger) Success

func (l VerboseLogger) Success(s string, args ...interface{})

Success will log with success text decoration and line ending

func (VerboseLogger) Warn

func (l VerboseLogger) Warn(s string, args ...interface{})

Warn will log with warning text decoration and line ending

Jump to

Keyboard shortcuts

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