run everything through the daemon check to switch to fmt
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
366bcac15c
commit
91b0564fb0
6
bool.go
6
bool.go
|
@ -4,11 +4,7 @@
|
||||||
|
|
||||||
package log
|
package log
|
||||||
|
|
||||||
import (
|
|
||||||
golanglog "log"
|
|
||||||
)
|
|
||||||
|
|
||||||
func Bool(b bool, a ...any) {
|
func Bool(b bool, a ...any) {
|
||||||
if ! b {return}
|
if ! b {return}
|
||||||
golanglog.Println(a...)
|
realPrintln(a...)
|
||||||
}
|
}
|
||||||
|
|
8
info.go
8
info.go
|
@ -4,18 +4,14 @@
|
||||||
|
|
||||||
package log
|
package log
|
||||||
|
|
||||||
import (
|
|
||||||
golanglog "log"
|
|
||||||
)
|
|
||||||
|
|
||||||
func Info(a ...any) {
|
func Info(a ...any) {
|
||||||
if ! INFO.Ok() { return }
|
if ! INFO.Ok() { return }
|
||||||
if ! INFO.b { return }
|
if ! INFO.b { return }
|
||||||
golanglog.Println(a...)
|
realPrintln(a...)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Infof(s string, a ...any) {
|
func Infof(s string, a ...any) {
|
||||||
if ! INFO.Ok() { return }
|
if ! INFO.Ok() { return }
|
||||||
if ! INFO.b { return }
|
if ! INFO.b { return }
|
||||||
golanglog.Printf(s, a...)
|
realPrintf(s, a...)
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,17 +13,17 @@ import (
|
||||||
func SetTmpOLD() {
|
func SetTmpOLD() {
|
||||||
f, err := os.OpenFile("/tmp/guilogfile", os.O_RDWR | os.O_CREATE | os.O_APPEND, 0666)
|
f, err := os.OpenFile("/tmp/guilogfile", os.O_RDWR | os.O_CREATE | os.O_APPEND, 0666)
|
||||||
if err != nil {
|
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()
|
// hmm. is there a trick here or must this be in main()
|
||||||
// defer f.Close()
|
// defer f.Close()
|
||||||
|
|
||||||
golanglog.SetOutput(f)
|
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
|
// start writing all the logging to a tmp file
|
||||||
func UnsetTmp() {
|
func UnsetTmp() {
|
||||||
golanglog.SetOutput(os.Stdout)
|
golanglog.SetOutput(os.Stdout)
|
||||||
golanglog.Println("This is a test log entry")
|
realPrintln("This is a test log entry")
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,12 +4,8 @@
|
||||||
|
|
||||||
package log
|
package log
|
||||||
|
|
||||||
import (
|
|
||||||
golanglog "log"
|
|
||||||
)
|
|
||||||
|
|
||||||
func Verbose(a ...any) {
|
func Verbose(a ...any) {
|
||||||
if ! VERBOSE.Ok() { return }
|
if ! VERBOSE.Ok() { return }
|
||||||
if ! VERBOSE.b { return }
|
if ! VERBOSE.b { return }
|
||||||
golanglog.Println(a...)
|
realPrintln(a...)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue