独立日志文件添加门面方法
This commit is contained in:
parent
523bce41ca
commit
a3610c56c1
|
@ -41,6 +41,12 @@ func NewLogger() {
|
|||
LevelString[level], loggerType, loggerSyncInterval))
|
||||
}
|
||||
|
||||
// LogFile, new log file save.
|
||||
func LogFile(fileName string) *Logger {
|
||||
checkLogNil()
|
||||
return logFacede.LogFile(fileName)
|
||||
}
|
||||
|
||||
// Debug, record DEBUG message.
|
||||
func Debug(format string, a ...interface{}) {
|
||||
checkLogNil()
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
[app.logger]
|
||||
level = "INFO"
|
||||
type = "text"
|
||||
path = ""
|
||||
path = "./logs"
|
||||
syncInterval = 2
|
||||
[app.session]
|
||||
isOpen = true
|
||||
|
|
|
@ -26,8 +26,7 @@ func AuthCheck(c *app.Context) error {
|
|||
func Test(c *app.Context) error {
|
||||
|
||||
opennum := cfg.GetIntFlag("opennum")
|
||||
logger.Error("error logs %d", opennum)
|
||||
|
||||
logger.LogFile("api").Error("error logs %d", opennum)
|
||||
return c.ToJson(map[string]interface{}{
|
||||
"test": "123",
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue