feat: make logging and temperature monitoring optional (#35)
* feat: make logging and temperature monitoring optional * chore: improve code style * fix: import --------- Co-authored-by: naiba <[email protected]>
This commit is contained in:
+8
-6
@@ -19,11 +19,13 @@ func IsWindows() bool {
|
||||
return os.PathSeparator == '\\' && os.PathListSeparator == ';'
|
||||
}
|
||||
|
||||
func Println(v ...interface{}) {
|
||||
if runtime.GOOS != "darwin" {
|
||||
Logger.Infof("NEZHA@%s>> %v", time.Now().Format("2006-01-02 15:04:05"), fmt.Sprint(v...))
|
||||
} else {
|
||||
fmt.Printf("NEZHA@%s>> ", time.Now().Format("2006-01-02 15:04:05"))
|
||||
fmt.Println(v...)
|
||||
func Println(disabled bool, v ...interface{}) {
|
||||
if !disabled {
|
||||
if runtime.GOOS != "darwin" {
|
||||
Logger.Infof("NEZHA@%s>> %v", time.Now().Format("2006-01-02 15:04:05"), fmt.Sprint(v...))
|
||||
} else {
|
||||
fmt.Printf("NEZHA@%s>> ", time.Now().Format("2006-01-02 15:04:05"))
|
||||
fmt.Println(v...)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user