21 lines
248 B
Go
21 lines
248 B
Go
package log
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
var IsDebug bool
|
|
|
|
func init() {
|
|
if os.Getenv("DEBUG") == "1" || os.Getenv("DEBUG") == "true" {
|
|
IsDebug = true
|
|
}
|
|
}
|
|
|
|
func Debug(a ...any) {
|
|
if IsDebug {
|
|
fmt.Println(append([]any{"[DEBUG]"}, a...)...)
|
|
}
|
|
}
|