modulepackage
0.0.0-20200815012803-c44589d97465
Repository: https://github.com/go-baa/log.git
Documentation: pkg.go.dev
# README
log
a logger extend standard log package for baa.
- more log level, Info/Warn/Error/Debug
- more log method
- optimize log write
- used for configless
Install
- dependent setting package
- optional config file:
conf/app.ini
go get -u github.com/go-baa/setting
go get -u github.com/go-baa/log
Usage
package main
import (
"github.com/go-baa/log"
)
func main() {
log.Println("xx")
log.Debugln("xx")
}
Config
config depend config file of setting
,you need add follow lines to config file:
// conf/app.ini
[default]
# output log to os.Stderr or filepath
log.file = os.Stderr
# 0 off, 1 fatal, 2 panic, 5 error, 6 warn, 10 info, 11 debug
log.level = 11
log.file
setting log to file, it is be a file path, also can be os.Stderr
or os.Stdout
.
log.level
setting log level, default is 5
, The greater the level of output error the more detailed.
# Functions
No description provided by the author
No description provided by the author
No description provided by the author
Default 返回默认日志器.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Flags returns the standard flags.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
New 创建一个新的日志记录器.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Constants
the date in the local time zone: 2009/01/23.
full file name and line number: /a/b/c/d.go:23.
microsecond resolution: 01:23:23.123123.
12.
5.
1.
11.
-1.
2.
0.
-2.
6.
final file name element and line number: d.go:23.
initial values for the standard logger.
the time in the local time zone: 01:23:23.
if Ldate or Ltime is set, use UTC rather than the local time zone.
# Interfaces
Logger interface.
# Type aliases
LogLevel 日志级别.