aboutsummaryrefslogtreecommitdiffhomepage
path: root/container/init.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-09-28 21:51:10 +0900
committerOphestra <cat@gensokyo.uk>2025-09-28 21:51:10 +0900
commite55822c62f7287698a683e6e7e40aa9a992b5585 (patch)
tree19f5e8e2614c86c9a79f8264b49a2b48e13fabee /container/init.go
parent802e6afa34de7f6124157153b0bde4ac25d7b363 (diff)
container/init: reduce verbose noise
This makes it possible to optionally omit the identifying verbose message, for when the Op implementation can provide a much more useful message in its case, using information not yet available to the String method. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'container/init.go')
-rw-r--r--container/init.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/container/init.go b/container/init.go
index c2208be4..73478b5a 100644
--- a/container/init.go
+++ b/container/init.go
@@ -47,7 +47,9 @@ type (
// apply is called in intermediate root.
apply(state *setupState, k syscallDispatcher) error
- prefix() string
+ // prefix returns a log message prefix, and whether this Op prints no identifying message on its own.
+ prefix() (string, bool)
+
Is(op Op) bool
Valid() bool
fmt.Stringer
@@ -223,7 +225,9 @@ func initEntrypoint(k syscallDispatcher, prepareLogger func(prefix string), setV
chdir is allowed but discouraged */
for i, op := range *params.Ops {
// ops already checked during early setup
- k.verbosef("%s %s", op.prefix(), op)
+ if prefix, ok := op.prefix(); ok {
+ k.verbosef("%s %s", prefix, op)
+ }
if err := op.apply(state, k); err != nil {
if m, ok := messageFromError(err); ok {
k.fatal(m)