12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- package logs
- import (
- "Cold_WorkOrder/conf"
- "github.com/astaxie/beego/logs"
- "runtime"
- )
- var logx *logs.BeeLogger
- var Test = true
- func init() {
- logx = logs.NewLogger()
- logx.SetLogger(logs.AdapterFile, `{"filename":"logs/logx/logx.log"}`)
- logx.EnableFuncCallDepth(true)
- logx.SetLogFuncCallDepth(3)
- if conf.RunMode == "dev" {
- logx.SetLogger("console")
- }
- if runtime.GOOS == "windows" {
- Test = true
- } else {
- Test = false
- }
- }
- func Println(format string, v ...interface{}) {
- logx.Info(format, v...)
- }
- // Debug Log DEBUG level message.
- func Debug(format string, v ...interface{}) {
- logx.Debug(format, v...)
- }
- // Info Log ERROR level message.
- func Info(format string, v ...interface{}) {
- logx.Info(format, v...)
- }
- // Error Log ERROR level message.
- func Error(format string, v ...interface{}) {
- logx.Error(format, v...)
- }
- // Warning Log WARNING level message.
- func Warning(format string, v ...interface{}) {
- logx.Warning(format, v...)
- }
|