From e55822c62f7287698a683e6e7e40aa9a992b5585 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sun, 28 Sep 2025 21:51:10 +0900 Subject: 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 --- container/init.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'container/init.go') 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) -- cgit v1.3.1