log

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2019 License: Apache-2.0 Imports: 1 Imported by: 17

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogPrint

func LogPrint(v ...interface{})

LogPrint prints the log.

func LogPrintf

func LogPrintf(format string, v ...interface{})

LogPrintf prints the log with the format.

func SetLogger

func SetLogger(l Logger)

SetLogger sets the current logger.

Types

type DefaultLogger

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

DefaultLogger is the implementation for a Logger using golang log.

func (*DefaultLogger) EnableLog

func (l *DefaultLogger) EnableLog(enable bool)

func (*DefaultLogger) IsEnabled

func (l *DefaultLogger) IsEnabled() bool

func (*DefaultLogger) Print

func (l *DefaultLogger) Print(v ...interface{})

func (*DefaultLogger) Printf

func (l *DefaultLogger) Printf(format string, v ...interface{})

type Logger

type Logger interface {
	//EnableLog controls whether print the message.
	EnableLog(bool)

	//IsEnabled returns if logger is enabled.
	IsEnabled() bool

	//Print formats using the default formats for its operands and logs the message.
	Print(...interface{})

	//Printf formats according to a format specifier and logs the message.
	Printf(string, ...interface{})
}

Logger is the logging interface implementation.

func GetLogger

func GetLogger() Logger

GetLogger returns the current logger.

Jump to

Keyboard shortcuts

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