log.go 362 字节
Newer Older
E
eoLinker API Management 已提交
1 2 3
package console

import (
黄孟柱 已提交
4 5
	module "github.com/eolinker/goku-api-gateway/console/module/config-log"
	log "github.com/eolinker/goku-api-gateway/goku-log"
E
eoLinker API Management 已提交
6 7
)

Y
Your Name 已提交
8
func InitLog() {
E
eoLinker API Management 已提交
9 10
	c, _ := module.Get(module.ConsoleLog)

Y
Your Name 已提交
11 12 13
	period, _ := log.ParsePeriod(c.Period)
	log.SetOutPut(c.Enable, c.Dir, c.File, period, c.Expire)
	l, _ := log.ParseLevel(c.Level)
E
eoLinker API Management 已提交
14
	log.SetLevel(l)
Y
Your Name 已提交
15
}