mlog

package
v4.10.6+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2019 License: AGPL-3.0, Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Very verbose messages for debugging specific issues
	LevelDebug = "debug"
	// Default log level, informational
	LevelInfo = "info"
	// Warnings are messages about possible issues
	LevelWarn = "warn"
	// Errors are messages about things we know are problems
	LevelError = "error"
)

Variables

View Source
var Err = zap.Error
View Source
var Int = zap.Int
View Source
var Int64 = zap.Int64
View Source
var String = zap.String

Functions

func GloballyDisableDebugLogForTest

func GloballyDisableDebugLogForTest()

DON'T USE THIS Modify the level on the app logger

func GloballyEnableDebugLogForTest

func GloballyEnableDebugLogForTest()

DON'T USE THIS Modify the level on the app logger

func InitGlobalLogger

func InitGlobalLogger(logger *Logger)

func RedirectStdLog

func RedirectStdLog(logger *Logger)

Types

type Field

type Field = zapcore.Field

Type and function aliases from zap to limit the libraries scope into MM code

type LogFunc

type LogFunc func(string, ...Field)
var Critical LogFunc = defaultCriticalLog
var Debug LogFunc = defaultDebugLog
var Error LogFunc = defaultErrorLog
var Info LogFunc = defaultInfoLog
var Warn LogFunc = defaultWarnLog

type Logger

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

func NewLogger

func NewLogger(config *LoggerConfiguration) *Logger

func (*Logger) ChangeLevels

func (l *Logger) ChangeLevels(config *LoggerConfiguration)

func (*Logger) Critical

func (l *Logger) Critical(message string, fields ...Field)

func (*Logger) Debug

func (l *Logger) Debug(message string, fields ...Field)

func (*Logger) Error

func (l *Logger) Error(message string, fields ...Field)

func (*Logger) Info

func (l *Logger) Info(message string, fields ...Field)

func (*Logger) SetConsoleLevel

func (l *Logger) SetConsoleLevel(level string)

func (*Logger) StdLog

func (l *Logger) StdLog(fields ...Field) *log.Logger

func (*Logger) Warn

func (l *Logger) Warn(message string, fields ...Field)

func (*Logger) With

func (l *Logger) With(fields ...Field) *Logger

type LoggerConfiguration

type LoggerConfiguration struct {
	EnableConsole bool
	ConsoleJson   bool
	ConsoleLevel  string
	EnableFile    bool
	FileJson      bool
	FileLevel     string
	FileLocation  string
}

Jump to

Keyboard shortcuts

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