2019-02-02 16:18:25 +08:00
|
|
|
// 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,
|
2019-02-02 16:18:25 +08:00
|
|
|
// You can obtain one at https://github.com/gogf/gf.
|
2018-09-26 09:58:49 +08:00
|
|
|
|
|
|
|
package g
|
|
|
|
|
2018-11-01 09:46:35 +08:00
|
|
|
import (
|
2019-06-19 09:06:52 +08:00
|
|
|
"github.com/gogf/gf/g/os/glog"
|
2018-11-01 09:46:35 +08:00
|
|
|
)
|
|
|
|
|
2019-04-04 22:52:56 +08:00
|
|
|
// SetDebug disables/enables debug level for logging 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
|
|
|
}
|
|
|
|
|
2019-04-04 22:52:56 +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
|
|
|
}
|
|
|
|
|
2019-04-04 22:52:56 +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()
|
|
|
|
}
|