log

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2018 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debugf

func Debugf(format string, args ...interface{})

Debugf logs a 'debug' message to the log file and echoes it to the console.

func Error

func Error(err error)

Error logs an 'error' value to the log file and echoes it to the console.

func Errorf

func Errorf(format string, args ...interface{})

Errorf logs an 'error' message to the log file and echoes it to the console.

func Fatalf

func Fatalf(format string, args ...interface{})

Fatalf logs a 'fatal' message to the log file and echoes it to the console. Application will terminate after logging.

func Infof

func Infof(format string, args ...interface{})

Infof logs an 'info' message to the log file and echoes it to the console.

func Initialize

func Initialize(cfg *Config)

Initialize initializes the default log subsystem.

func Shutdown

func Shutdown()

Shutdown shuts down log sub system. This method should be used only for testing purposes.

func Warnf

func Warnf(format string, args ...interface{})

Warnf logs a 'warning' message to the log file and echoes it to the console.

Types

type Config added in v0.2.0

type Config struct {
	Level   LogLevel
	LogPath string
}

Config represents a logger manager configuration.

func (*Config) UnmarshalYAML added in v0.2.0

func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML satisfies Unmarshaler interface.

type LogLevel added in v0.2.0

type LogLevel int

LogLevel represents log level type.

const (
	// DebugLevel represents DEBUG log level.
	DebugLevel LogLevel = iota

	// InfoLevel represents INFO log level.
	InfoLevel

	// WarningLevel represents WARNING log level.
	WarningLevel

	// ErrorLevel represents ERROR log level.
	ErrorLevel

	// FatalLevel represents FATAL log level.
	FatalLevel
)

type Logger

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

Logger object is used to log messages for a specific system or application component.

Jump to

Keyboard shortcuts

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