run everything through the daemon check to switch to fmt

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-10-12 16:36:44 -05:00
parent 366bcac15c
commit 91b0564fb0
4 changed files with 7 additions and 19 deletions

View File

@ -4,11 +4,7 @@
package log
import (
golanglog "log"
)
func Bool(b bool, a ...any) {
if ! b {return}
golanglog.Println(a...)
realPrintln(a...)
}

View File

@ -4,18 +4,14 @@
package log
import (
golanglog "log"
)
func Info(a ...any) {
if ! INFO.Ok() { return }
if ! INFO.b { return }
golanglog.Println(a...)
realPrintln(a...)
}
func Infof(s string, a ...any) {
if ! INFO.Ok() { return }
if ! INFO.b { return }
golanglog.Printf(s, a...)
realPrintf(s, a...)
}

View File

@ -13,17 +13,17 @@ import (
func SetTmpOLD() {
f, err := os.OpenFile("/tmp/guilogfile", os.O_RDWR | os.O_CREATE | os.O_APPEND, 0666)
if err != nil {
golanglog.Fatalf("error opening file: %v", err)
realFatalf("error opening file: %v", err)
}
// hmm. is there a trick here or must this be in main()
// defer f.Close()
golanglog.SetOutput(f)
golanglog.Println("This is a test log entry")
realPrintln("This is a test log entry")
}
// start writing all the logging to a tmp file
func UnsetTmp() {
golanglog.SetOutput(os.Stdout)
golanglog.Println("This is a test log entry")
realPrintln("This is a test log entry")
}

View File

@ -4,12 +4,8 @@
package log
import (
golanglog "log"
)
func Verbose(a ...any) {
if ! VERBOSE.Ok() { return }
if ! VERBOSE.b { return }
golanglog.Println(a...)
realPrintln(a...)
}