mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
feat: added modules
This commit is contained in:
18
core/utils/debug.go
Normal file
18
core/utils/debug.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/spf13/viper"
|
||||
"time"
|
||||
)
|
||||
|
||||
func IsDebug() bool {
|
||||
return viper.GetBool("debug")
|
||||
}
|
||||
|
||||
func LogDebug(msg string) {
|
||||
if !IsDebug() {
|
||||
return
|
||||
}
|
||||
fmt.Println(fmt.Sprintf("[DEBUG] %s: %s", time.Now().Format("2006-01-02 15:04:05"), msg))
|
||||
}
|
||||
Reference in New Issue
Block a user