logger

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package logger hosts the small logger wrapper internally used by pina-golada to encapsulate the verbose logic to one instance.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultLogger

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

DefaultLogger defines the default logger implementation

func NewDefaultLogger

func NewDefaultLogger(outputStream io.Writer, highestLogLevel LogLevel) *DefaultLogger

NewDefaultLogger creates a new default logger

func (*DefaultLogger) Debug

func (d *DefaultLogger) Debug(message string, a ...interface{})

Debug logs the message on the debug level

func (*DefaultLogger) Info

func (d *DefaultLogger) Info(message string, a ...interface{})

Info logs the message on the info level

func (*DefaultLogger) Log

func (d *DefaultLogger) Log(level LogLevel, message string, a ...interface{})

Log logs the message with the given log level

type LogLevel

type LogLevel uint32

LogLevel defines the type of level the logger will log at

const (
	// Info defines the info level which will always be printed
	Info LogLevel = iota

	// Debug defines the debug level which will be printed
	Debug
)

type Logger

type Logger interface {
	Log(level LogLevel, message string, a ...interface{})
	Info(message string, a ...interface{})
	Debug(message string, a ...interface{})
}

Logger defines a logger that prints strings to the general output

Log logs the message with the given log level

Info logs the message on the info level

Debug logs the message on the debug level

Jump to

Keyboard shortcuts

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