ratchet: github.com/dailyburn/ratchet/logger Index | Files

package logger

import "github.com/dailyburn/ratchet/logger"

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

Index

Package Files

logger.go

Constants

const (
    LevelDebug = iota
    LevelInfo
    LevelError
    LevelStatus
    LevelSilent
)

Ordering the importance of log information. See LogLevel below.

Variables

var LogLevel = LevelInfo

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

func Debug Uses

func Debug(v ...interface{})

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

func Error Uses

func Error(v ...interface{})

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

func ErrorWithoutTrace Uses

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 Uses

func Info(v ...interface{})

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

func SetLogfile Uses

func SetLogfile(filepath string)

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

func SetOutput Uses

func SetOutput(out io.Writer)

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

func Status Uses

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.

type RatchetNotifier Uses

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.

Package logger imports 4 packages (graph) and is imported by 13 packages. Updated 2016-09-06. Refresh now. Tools for package owners.