log

package
Version: v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package log contains a wrapper of the 'log' package with command utility functions, includig colourised output.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Colorize

func Colorize(colour Colour, format string) string

Colorize returns a coloured log string

func Debug

func Debug(format string, v ...interface{})

Debug logging

func Error

func Error(format string, v ...interface{})

Error logging

func Fatal

func Fatal(v ...interface{})

Fatal logging

func Fatalf

func Fatalf(format string, v ...interface{})

Fatalf is formatted fatal logging

func Info

func Info(format string, v ...interface{})

Info logging

func Log

func Log(l Level, format string, v ...interface{})

Log general log method

func SetLevel

func SetLevel(l Level)

SetLevel sets log level

func Trace

func Trace(format string, v ...interface{})

Trace logging

func Warn

func Warn(format string, v ...interface{})

Warn logging

Types

type Colour

type Colour int

Colour type to print in log messages

const (
	BLACK Colour = iota
	BLUE
	RED
	GREEN
	GREY
	YELLOW
	MAGENTA
	CYAN
	WHITE
	LIGHTBLACK
	LIGHTRED
	LIGHTGREEN
	LIGHTYELLOW
	LIGHTBLUE
	LIGHTMAGENTA
	LIGHTCYAN
	LIGHTWHITE
)

nolint

type Level

type Level int

Level to set

const (
	TRACE Level = iota
	DEBUG
	INFO
	WARN
	ERROR
	FATAL
	NONE
)

nolint

type MuxyLogger

type MuxyLogger struct {
	log.Logger
	Level Level
}

MuxyLogger is the logging facility for Muxy

func NewLogger

func NewLogger() *MuxyLogger

NewLogger creates a new logger

func (*MuxyLogger) Debug

func (m *MuxyLogger) Debug(format string, v ...interface{})

Debug logging

func (*MuxyLogger) Error

func (m *MuxyLogger) Error(format string, v ...interface{})

Error logging

func (*MuxyLogger) Fatal

func (m *MuxyLogger) Fatal(v ...interface{})

Fatal logging

func (*MuxyLogger) Fatalf

func (m *MuxyLogger) Fatalf(format string, v ...interface{})

Fatalf formatted fatal logging

func (*MuxyLogger) Info

func (m *MuxyLogger) Info(format string, v ...interface{})

Info loggig

func (*MuxyLogger) Log

func (m *MuxyLogger) Log(l Level, format string, v ...interface{})

Log is general log facility

func (*MuxyLogger) SetLevel

func (m *MuxyLogger) SetLevel(l Level)

SetLevel sets the log level

func (*MuxyLogger) Trace

func (m *MuxyLogger) Trace(format string, v ...interface{})

Trace Logging

func (*MuxyLogger) Warn

func (m *MuxyLogger) Warn(format string, v ...interface{})

Warn logging

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL