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 ¶
InitLogging2 initializes the logging.
If filepath is empty, it will use Stdout as the writer.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.