log

package
v0.0.0-...-28fadcf Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package log provides logging interfaces.

Index

Constants

View Source
const (
	FATAL = 0
	ERROR = 1
	WARN  = 2
	INFO  = 3
	DEBUG = 4
)

Log Level

Variables

This section is empty.

Functions

func Close

func Close() error

Close closes the open log file.

func Debug

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

Debug use the Error log level write data

func Debugln

func Debugln(args ...interface{})

Debugln like Debug but ignore format

func Error

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

Error use the Error log level write data

func Errorln

func Errorln(args ...interface{})

Errorln like Error but ignore format

func Fatal

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

Fatal use the Fatal level write data

func Fatalln

func Fatalln(args ...interface{})

Fatalln like fatal bug ignore format

func Info

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

Info use the Info log level write data

func Infoln

func Infoln(args ...interface{})

Infoln like info bug ignore format

func Setup

func Setup(file string, level int) (err error)

Setup creates a new Logger and hold it in this package. The out variable sets the destination to which log data will be written. The prefix appears at the beginning of each generated log line. The file argument defines the write log file path. if any error the os.Stdout will return

func Warn

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

Warn use the Warn level write data

func Warnln

func Warnln(args ...interface{})

Warnln like Warn but ignore format

Types

type Logger

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

Logger represents an active logging object that generates lines of output to an io.Writer. Each logging operation makes a single call to theWriter's Write method. A Logger can be used simultaneously from multiple goroutines it guarantees to serialize access to the Writer.

func New

func New(file string, levelIn int) (*Logger, error)

New returns an Logger

Jump to

Keyboard shortcuts

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