summaryrefslogtreecommitdiff
path: root/reallog.go
diff options
context:
space:
mode:
Diffstat (limited to 'reallog.go')
-rw-r--r--reallog.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/reallog.go b/reallog.go
index 37a290a..f44abdc 100644
--- a/reallog.go
+++ b/reallog.go
@@ -11,6 +11,14 @@ import (
"time"
)
+func Off() {
+ off = true
+}
+
+func On() {
+ off = false
+}
+
func DaemonMode(b bool) {
daemonMode = b
}
@@ -53,6 +61,9 @@ func DaemonShow() bool {
}
func realPrintln(a ...any) {
+ if off {
+ return
+ }
if daemonMode {
// in daemon mode, don't put timestamps on each line
if captureMode == nil {
@@ -88,6 +99,9 @@ func realPrintln(a ...any) {
}
func realPrintf(s string, a ...any) {
+ if off {
+ return
+ }
if daemonMode {
// in daemon mode, don't put timestamps on each line
if captureMode == nil {
@@ -133,6 +147,14 @@ func realSprintln(a ...any) string {
return fmt.Sprintln(a...)
}
+func realFprintln(w io.Writer, a ...any) (int, error) {
+ return fmt.Fprintln(w, a...)
+}
+
+func realFprintf(w io.Writer, s string, a ...any) (int, error) {
+ return fmt.Fprintf(w, s, a...)
+}
+
func realFatalln(a ...any) {
reallog.Fatalln(a...)
}