feat: initial commit
This commit is contained in:
commit
693724d3b8
7 changed files with 116 additions and 0 deletions
21
cmd/logger/debug.go
Normal file
21
cmd/logger/debug.go
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
package logging
|
||||
|
||||
import (
|
||||
"io"
|
||||
"log"
|
||||
)
|
||||
|
||||
var debug bool
|
||||
|
||||
// Enables debug logging if set to true. Default is false.
|
||||
func SetDebug(debugSetting bool) {
|
||||
debug = debugSetting
|
||||
if !debug {
|
||||
log.SetOutput(io.Discard)
|
||||
}
|
||||
}
|
||||
|
||||
// Returns the current debug value as a boolean.
|
||||
func GetDebug() bool {
|
||||
return debug
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue