logger

package
v2.0.105+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2019 License: MIT Imports: 4 Imported by: 4

Documentation

Overview

Package logger is a simple but customizable logger used by ratchet.

Index

Constants

View Source
const (
	LevelDebug = iota
	LevelInfo
	LevelError
	LevelStatus
	LevelSilent
)

Ordering the importance of log information. See LogLevel below.

Variables

View Source
var LogLevel = LevelInfo

LogLevel can be set to one of: logger.LevelDebug, logger.LevelInfo, logger.LevelError, logger.LevelStatus, or logger.LevelSilent

Functions

func Debug

func Debug(v ...interface{})

Debug logs output when LogLevel is set to at least Debug level

func Error

func Error(v ...interface{})

Error logs output when LogLevel is set to at least Error level

func ErrorWithoutTrace

func ErrorWithoutTrace(v ...interface{})

ErrorWithoutTrace logs output when LogLevel is set to at least Error level but doesn't send the stack trace to Notifier. This is useful only when using a RatchetNotifier implementation.

func Info

func Info(v ...interface{})

Info logs output when LogLevel is set to at least Info level

func SetLogfile

func SetLogfile(filepath string)

SetLogfile can be used to log to a file as well as Stdoud.

func SetOutput

func SetOutput(out io.Writer)

SetOutput allows setting log output to any custom io.Writer.

func Status

func Status(v ...interface{})

Status logs output when LogLevel is set to at least Status level Status output is high-level status events like stages starting/completing.

Types

type RatchetNotifier

type RatchetNotifier interface {
	RatchetNotify(lvl int, trace []byte, v ...interface{})
}

RatchetNotifier is an interface for receiving log events. See the Notifier variable.

var Notifier RatchetNotifier

Notifier can be set to receive log events in your external implementation code. Useful for doing custom alerting, etc.

Jump to

Keyboard shortcuts

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