aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/state/print.go
diff options
context:
space:
mode:
authorOphestra Umiker <cat@ophivana.moe>2024-10-26 23:09:32 +0900
committerOphestra Umiker <cat@ophivana.moe>2024-10-26 23:09:32 +0900
commitae1a102882103221ef842176dfd8cb1090d5f591 (patch)
tree16f34686bac5564998a9a0e84be96d83ed3e59bd /internal/state/print.go
parent093e99d062f873dc9d83b1f76a156c1ee4275c57 (diff)
fmsg: support temporarily withholding output
Trying to print to a shared stdout is a terrible idea. This change makes it possible to withhold output for the lifetime of the sandbox. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
Diffstat (limited to 'internal/state/print.go')
-rw-r--r--internal/state/print.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/internal/state/print.go b/internal/state/print.go
index d8f08fac..8ca3529e 100644
--- a/internal/state/print.go
+++ b/internal/state/print.go
@@ -21,8 +21,7 @@ func MustPrintLauncherStateSimpleGlobal(w **tabwriter.Writer, runDir string) {
// read runtime directory to get all UIDs
if dirs, err := os.ReadDir(path.Join(runDir, "state")); err != nil && !errors.Is(err, os.ErrNotExist) {
- fmsg.Println("cannot read runtime directory:", err)
- os.Exit(1)
+ fmsg.Fatal("cannot read runtime directory:", err)
} else {
for _, e := range dirs {
// skip non-directories
@@ -112,13 +111,11 @@ func (s *simpleStore) mustPrintLauncherState(w **tabwriter.Writer, now time.Time
}); err != nil {
fmsg.Printf("cannot perform action on store %q: %s", path.Join(s.path...), err)
if !ok {
- fmsg.Println("store faulted before printing")
- os.Exit(1)
+ fmsg.Fatal("store faulted before printing")
}
}
if innerErr != nil {
- fmsg.Printf("cannot print launcher state for store %q: %s", path.Join(s.path...), innerErr)
- os.Exit(1)
+ fmsg.Fatalf("cannot print launcher state for store %q: %s", path.Join(s.path...), innerErr)
}
}