github.com/zhongdalu/gf@v1.0.0/g/g_logger.go (about)

     1  // Copyright 2018 gf Author(https://github.com/zhongdalu/gf). All Rights Reserved.
     2  //
     3  // This Source Code Form is subject to the terms of the MIT License.
     4  // If a copy of the MIT was not distributed with this file,
     5  // You can obtain one at https://github.com/zhongdalu/gf.
     6  
     7  package g
     8  
     9  import (
    10  	"github.com/zhongdalu/gf/g/os/glog"
    11  )
    12  
    13  // SetDebug disables/enables debug level for logging component globally.
    14  func SetDebug(debug bool) {
    15  	glog.SetDebug(debug)
    16  }
    17  
    18  // SetLogLevel sets the logging level globally.
    19  func SetLogLevel(level int) {
    20  	glog.SetLevel(level)
    21  }
    22  
    23  // GetLogLevel returns the global logging level.
    24  func GetLogLevel() int {
    25  	return glog.GetLevel()
    26  }