gf/g/g_logger.go

26 lines
649 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 (
"github.com/gogf/gf/g/os/glog"
)
// SetDebug disables/enables debug level for logging globally.
2018-10-30 23:58:10 +08:00
func SetDebug(debug bool) {
glog.SetDebug(debug)
}
// SetLogLevel sets the logging level globally.
2018-10-30 23:58:10 +08:00
func SetLogLevel(level int) {
glog.SetLevel(level)
}
// GetLogLevel returns the global logging level.
2018-10-30 23:58:10 +08:00
func GetLogLevel() int {
return glog.GetLevel()
}