mirror of
https://github.com/duanhf2012/origin.git
synced 2026-05-13 19:27:32 +08:00
新增日志服务
This commit is contained in:
25
sysservice/logservice.go
Normal file
25
sysservice/logservice.go
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
package sysservice
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/duanhf2012/origin/service"
|
||||||
|
"github.com/duanhf2012/origin/sysmodule"
|
||||||
|
)
|
||||||
|
|
||||||
|
type LogService struct {
|
||||||
|
service.BaseService
|
||||||
|
logmodule *sysmodule.LogModule
|
||||||
|
}
|
||||||
|
|
||||||
|
func (slf *LogService) InitLog(logservicename string, openLevel uint) {
|
||||||
|
slf.SetServiceName(logservicename)
|
||||||
|
slf.logmodule = &sysmodule.LogModule{}
|
||||||
|
slf.logmodule.Init(logservicename, openLevel)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (slf *LogService) Printf(level uint, format string, v ...interface{}) {
|
||||||
|
slf.logmodule.Printf(level, format, v...)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (slf *LogService) Print(level uint, v ...interface{}) {
|
||||||
|
slf.logmodule.Print(level, v...)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user