log

package
v0.0.0-...-07c5cce Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug() *log.Logger

Helper functions to access a specific Logger

func Error

func Error() *log.Logger

func NewLogger

func NewLogger(level aurora.Value, o Options) *log.Logger

Returns a new Logger instance with specified options

func Request

func Request() *log.Logger

func Warn

func Warn() *log.Logger

func WithLevels

func WithLevels(o ...Options)

Initialize instance of LogWithLevels to be used whenever this package is used

Types

type LogWithLevels

type LogWithLevels struct {
	Debug   *log.Logger
	Warn    *log.Logger
	Error   *log.Logger
	Request *log.Logger
}

type Logger

type Logger struct {
	*log.Logger
	Options Options
	Aurora  aurora.Value
}

type Options

type Options struct {
	// Keyword wrapped with square brackets prefixed to log messages. Default: ""
	Prefix string
	// Disable colored logging. Default: false
	DisableColors bool
	// Output destination to write logs to. Default: os.Stdout
	Out io.Writer
	// Flags define the logging properties. See http://golang.org/pkg/log/#pkg-constants.
	// To disable all flags, set to `-1`. Default: log.LstdFlags (2006/01/02 15:04:05)
	Flags int
}

Jump to

Keyboard shortcuts

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