aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/environ.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 /internal/environ.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 'internal/environ.go')
-rw-r--r--internal/environ.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/internal/environ.go b/internal/environ.go
index 441c74ae..8f03cb34 100644
--- a/internal/environ.go
+++ b/internal/environ.go
@@ -1,13 +1,12 @@
package internal
import (
- "fmt"
"os"
"path"
"strconv"
"sync"
- "git.ophivana.moe/security/fortify/internal/verbose"
+ "git.ophivana.moe/security/fortify/internal/fmsg"
)
// state that remain constant for the lifetime of the process
@@ -37,16 +36,16 @@ func copySC() {
SharePath: path.Join(os.TempDir(), "fortify."+strconv.Itoa(os.Geteuid())),
}
- verbose.Println("process share directory at", sc.SharePath)
+ fmsg.VPrintf("process share directory at %q", sc.SharePath)
// runtimePath, runDirPath
if r, ok := os.LookupEnv(xdgRuntimeDir); !ok {
- fmt.Println("Env variable", xdgRuntimeDir, "unset")
+ fmsg.Println("variable", xdgRuntimeDir, "unset")
os.Exit(1)
} else {
sc.RuntimePath = r
sc.RunDirPath = path.Join(sc.RuntimePath, "fortify")
- verbose.Println("XDG runtime directory at", sc.RunDirPath)
+ fmsg.VPrintf("XDG runtime directory at %q", sc.RunDirPath)
}
scVal = sc