log

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LevelMsg is generic message log level
	LevelMsg = iota

	// LevelError is errors log level
	LevelError

	// LevelSuccess is success log level
	LevelSuccess

	// LevelWarn is warning log level
	LevelWarn

	// LevelInfo is info message log level
	LevelInfo

	// LevelDebug is debug messages log level
	LevelDebug
)

Variables

View Source
var Default sdk.Logger

Default is default logger instance

Functions

func UseConsoleLogger

func UseConsoleLogger(level int, noColor bool)

UseConsoleLogger bootstraps console logger as default log instance

func UseTestLogger added in v0.9.0

func UseTestLogger(t *testing.T)

UseTestLogger inits test logger

Types

type Formatter

type Formatter interface {
	// Next returns a new instance of formatter for sub-logger
	Next() Formatter

	// Format formats log message
	Format(format string, args ...interface{}) string

	// WrapString wraps log string
	WrapString(str string) string

	// WrapMultiline wraps multiline string
	WrapMultiline(str string) (out string)
}

Formatter formats log messages

type Writer

type Writer interface {
	// Write writes a message to log with specified level
	Write(level int, message string)
}

Writer is log writer

Jump to

Keyboard shortcuts

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