gf/g/g_logger.go

27 lines
648 B
Go
Raw Normal View History

// Copyright 2018 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2018-09-26 09:58:49 +08:00
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/gogf/gf.
2018-09-26 09:58:49 +08:00
package g
import (
2019-06-19 09:06:52 +08:00
"github.com/gogf/gf/g/os/glog"
)
2019-06-21 22:23:07 +08:00
// SetDebug disables/enables debug level for logging component globally.
2018-10-30 23:58:10 +08:00
func SetDebug(debug bool) {
2019-06-19 09:06:52 +08:00
glog.SetDebug(debug)
2018-10-30 23:58:10 +08:00
}
// SetLogLevel sets the logging level globally.
2018-10-30 23:58:10 +08:00
func SetLogLevel(level int) {
2019-06-19 09:06:52 +08:00
glog.SetLevel(level)
2018-10-30 23:58:10 +08:00
}
// GetLogLevel returns the global logging level.
2018-10-30 23:58:10 +08:00
func GetLogLevel() int {
2019-06-19 09:06:52 +08:00
return glog.GetLevel()
}