aboutsummaryrefslogtreecommitdiffhomepage
path: root/state.go
diff options
context:
space:
mode:
authorOphestra Umiker <cat@ophivana.moe>2024-10-21 20:47:02 +0900
committerOphestra Umiker <cat@ophivana.moe>2024-10-21 20:47:02 +0900
commit42e0b168e3d75389dfb968aebf9f5629d64782f9 (patch)
treee6b430205213c62bc06275c6d84e6037d40f5c3f /state.go
parent380d1f45851b7dffb963c51da96a17ba41f3cfb8 (diff)
fmsg: produce all output through fmsg
The behaviour of print functions from package fmt is not thread safe. Functions provided by fmsg wrap around Logger methods. This makes prefix much cleaner and makes it easy to deal with future changes to logging. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
Diffstat (limited to 'state.go')
-rw-r--r--state.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/state.go b/state.go
index 04355263..c4551ac3 100644
--- a/state.go
+++ b/state.go
@@ -7,6 +7,7 @@ import (
"text/tabwriter"
"git.ophivana.moe/security/fortify/internal"
+ "git.ophivana.moe/security/fortify/internal/fmsg"
"git.ophivana.moe/security/fortify/internal/state"
)
@@ -25,7 +26,7 @@ func tryState() {
state.MustPrintLauncherStateSimpleGlobal(&w, internal.GetSC().RunDirPath)
if w != nil {
if err := w.Flush(); err != nil {
- fmt.Println("warn: error formatting output:", err)
+ fmsg.Println("cannot format output:", err)
}
} else {
fmt.Println("No information available")