logmatic: github.com/borderstech/logmatic Index | Files

package logmatic

import "github.com/borderstech/logmatic"

Index

Package Files

level.go logger.go

Constants

const (
    TRACE = iota
    DEBUG
    INFO
    WARN
    ERROR
    FATAL
)

Log levels

type LogLevel Uses

type LogLevel uint8

LogLevel controls what log statements are activated for a given logger

type Logger Uses

type Logger struct {
    ExitOnFatal bool
    // contains filtered or unexported fields
}

Logger maintains a set of logging functions and has a log level that can be modified dynamically

func NewLogger Uses

func NewLogger() *Logger

NewLogger creates a new logger Default level is INFO

func (*Logger) Debug Uses

func (l *Logger) Debug(format string, a ...interface{})

Debug logs a debug statement DEBUG or lower

func (*Logger) Error Uses

func (l *Logger) Error(format string, a ...interface{})

Error logs an error statement ERROR or lower (any level)

func (*Logger) Fatal Uses

func (l *Logger) Fatal(format string, a ...interface{})

Fatal logs an error statement and exits the application FATAL or lower (any level)

func (*Logger) Info Uses

func (l *Logger) Info(format string, a ...interface{})

Info logs an info statement INFO or lower

func (*Logger) SetLevel Uses

func (l *Logger) SetLevel(level LogLevel)

SetLevel updates the logging level for future logs

func (*Logger) Trace Uses

func (l *Logger) Trace(format string, a ...interface{})

Trace logs a trace statement TRACE only

func (*Logger) Warn Uses

func (l *Logger) Warn(format string, a ...interface{})

Warn logs a warn statement WARN or lower

Package logmatic imports 4 packages (graph) and is imported by 2 packages. Updated 2019-01-14. Refresh now. Tools for package owners.