Disable logging by default, start logging onlu if DEBUG is set to 1
This commit is contained in:
parent
3c53798634
commit
802d6afc55
@ -67,7 +67,7 @@ func getUname() string {
|
||||
func Initialize() {
|
||||
err := os.MkdirAll(LogDirectory, 0750)
|
||||
if err != nil {
|
||||
RecoverPrettyPanic = false
|
||||
RecoverPrettyPanic = true
|
||||
DeadlockDetection = false
|
||||
WriteLogs = false
|
||||
return
|
||||
|
5
main.go
5
main.go
@ -63,13 +63,10 @@ func main() {
|
||||
debug.LogDirectory = debugDir
|
||||
}
|
||||
debugLevel := strings.ToLower(os.Getenv("DEBUG"))
|
||||
if debugLevel != "0" && debugLevel != "f" && debugLevel != "false" {
|
||||
debug.WriteLogs = true
|
||||
debug.RecoverPrettyPanic = true
|
||||
}
|
||||
if debugLevel == "1" || debugLevel == "t" || debugLevel == "true" {
|
||||
debug.RecoverPrettyPanic = false
|
||||
debug.DeadlockDetection = true
|
||||
debug.WriteLogs = true
|
||||
}
|
||||
debug.Initialize()
|
||||
defer debug.Recover()
|
||||
|
Loading…
Reference in New Issue
Block a user