aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/system/xhost.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/system/xhost.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/system/xhost.go')
-rw-r--r--internal/system/xhost.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/internal/system/xhost.go b/internal/system/xhost.go
index 4ed3f8bd..51c8d24f 100644
--- a/internal/system/xhost.go
+++ b/internal/system/xhost.go
@@ -4,7 +4,6 @@ import (
"fmt"
"git.ophivana.moe/security/fortify/internal/fmsg"
- "git.ophivana.moe/security/fortify/internal/verbose"
"git.ophivana.moe/security/fortify/xcb"
)
@@ -23,18 +22,18 @@ func (x XHost) Type() Enablement {
}
func (x XHost) apply(_ *I) error {
- verbose.Printf("inserting entry %s to X11\n", x)
+ fmsg.VPrintf("inserting entry %s to X11", x)
return fmsg.WrapErrorSuffix(xcb.ChangeHosts(xcb.HostModeInsert, xcb.FamilyServerInterpreted, "localuser\x00"+string(x)),
fmt.Sprintf("cannot insert entry %s to X11:", x))
}
func (x XHost) revert(_ *I, ec *Criteria) error {
if ec.hasType(x) {
- verbose.Printf("deleting entry %s from X11\n", x)
+ fmsg.VPrintf("deleting entry %s from X11", x)
return fmsg.WrapErrorSuffix(xcb.ChangeHosts(xcb.HostModeDelete, xcb.FamilyServerInterpreted, "localuser\x00"+string(x)),
fmt.Sprintf("cannot delete entry %s from X11:", x))
} else {
- verbose.Printf("skipping entry %s in X11\n", x)
+ fmsg.VPrintf("skipping entry %s in X11", x)
return nil
}
}