log

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package log is used to initialize the logger, and supplies some assistant functions about log.

Index

Constants

This section is empty.

Variables

View Source
var (
	E      = klog.E
	F      = klog.F
	Ef     = klog.Ef
	Tracef = klog.Tracef
	Debugf = klog.Debugf
	Infof  = klog.Infof
	Warnf  = klog.Warnf
	Errorf = klog.Errorf
	Printf = klog.Printf
	Panicf = klog.Panicf
	Fatalf = klog.Fatalf

	Trace = klog.Trace
	Debug = klog.Debug
	Info  = klog.Info
	Warn  = klog.Warn
	Error = klog.Error
	Panic = klog.Panic
	Fatal = klog.Fatal

	RegisterCallOnExit = klog.RegisterCallOnExit
)

Predefine some log functions.

Please refer to https://godoc.org/github.com/xgfone/klog

View Source
var LogOpts = []gconf.Opt{
	gconf.StrOpt("logfile", "The file path of the log. The default is stdout.").As("log_file"),
	gconf.StrOpt("loglevel", "The level of the log, such as debug, info").D("info").As("log_level"),
}

LogOpts collects the options about the log.

Functions

func InitLogging

func InitLogging(level, filepath string)

InitLogging is equal to InitLogging2(level, filepath, "100M", 100).

func InitLogging2

func InitLogging2(level, filepath, filesize string, filenum int)

InitLogging2 initializes the logging.

If filepath is empty, it will use Stdout as the writer.

func LogPanic

func LogPanic(name ...string)

LogPanic wrapps and logs the panic.

Types

This section is empty.

Jump to

Keyboard shortcuts

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