aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/system/mkdir.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/mkdir.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/mkdir.go')
-rw-r--r--internal/system/mkdir.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/internal/system/mkdir.go b/internal/system/mkdir.go
index 89dcd481..0f3787f6 100644
--- a/internal/system/mkdir.go
+++ b/internal/system/mkdir.go
@@ -6,7 +6,6 @@ import (
"os"
"git.ophivana.moe/security/fortify/internal/fmsg"
- "git.ophivana.moe/security/fortify/internal/verbose"
)
// Ensure the existence and mode of a directory.
@@ -37,7 +36,7 @@ func (m *Mkdir) Type() Enablement {
}
func (m *Mkdir) apply(_ *I) error {
- verbose.Println("ensuring directory", m)
+ fmsg.VPrintln("ensuring directory", m)
// create directory
err := os.Mkdir(m.path, m.perm)
@@ -58,11 +57,11 @@ func (m *Mkdir) revert(_ *I, ec *Criteria) error {
}
if ec.hasType(m) {
- verbose.Println("destroying ephemeral directory", m)
+ fmsg.VPrintln("destroying ephemeral directory", m)
return fmsg.WrapErrorSuffix(os.Remove(m.path),
fmt.Sprintf("cannot remove ephemeral directory %q:", m.path))
} else {
- verbose.Println("skipping ephemeral directory", m)
+ fmsg.VPrintln("skipping ephemeral directory", m)
return nil
}
}