fix timestamp not showing up
This commit is contained in:
parent
56145cd22a
commit
fe562dbf1b
10
reallog.go
10
reallog.go
|
@ -24,24 +24,28 @@ func HttpMode(w http.ResponseWriter) {
|
|||
httpMode = w
|
||||
}
|
||||
|
||||
func DaemonShow() {
|
||||
func DaemonShow() bool {
|
||||
if daemonMode {
|
||||
fmt.Println("daemonMode=true")
|
||||
return true
|
||||
} else {
|
||||
fmt.Println("daemonMode=false")
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
func realPrintln(a ...any) {
|
||||
if daemonMode {
|
||||
// in daemon mode, don't put timestamps on each line
|
||||
if captureMode == nil {
|
||||
fmt.Println(a...)
|
||||
} else {
|
||||
fmt.Fprintln(captureMode, a...)
|
||||
}
|
||||
} else {
|
||||
// put timestamps on each line
|
||||
if captureMode == nil {
|
||||
fmt.Println(a...)
|
||||
reallog.Println(a...)
|
||||
} else {
|
||||
// TODO: add datestamp
|
||||
fmt.Fprintln(captureMode, a...)
|
||||
|
@ -55,12 +59,14 @@ func realPrintln(a ...any) {
|
|||
|
||||
func realPrintf(s string, a ...any) {
|
||||
if daemonMode {
|
||||
// in daemon mode, don't put timestamps on each line
|
||||
if captureMode == nil {
|
||||
fmt.Printf(s, a...)
|
||||
} else {
|
||||
fmt.Fprintf(captureMode, s, a...)
|
||||
}
|
||||
} else {
|
||||
// put timestamps on each line
|
||||
if captureMode == nil {
|
||||
reallog.Printf(s, a...)
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue