mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-01 17:52:40 +00:00
main: Pass runtime CLI command to vc logger
Add the runtime CLI command name to the virtcontainers logger so that it is clear when reading virtcontainers log entries which runtime command they refer to. Fixes #448. Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
This commit is contained in:
parent
47dfb7d6da
commit
830d50e9c5
@ -235,10 +235,6 @@ func beforeSubcommands(context *cli.Context) error {
|
||||
return fmt.Errorf("unknown log-format %q", context.GlobalString("log-format"))
|
||||
}
|
||||
|
||||
setExternalLoggers(kataLog)
|
||||
|
||||
ignoreLogging := false
|
||||
|
||||
// Add the name of the sub-command to each log entry for easier
|
||||
// debugging.
|
||||
cmdName := context.Args().First()
|
||||
@ -246,6 +242,10 @@ func beforeSubcommands(context *cli.Context) error {
|
||||
kataLog = kataLog.WithField("command", cmdName)
|
||||
}
|
||||
|
||||
setExternalLoggers(kataLog)
|
||||
|
||||
ignoreLogging := false
|
||||
|
||||
if context.NArg() == 1 && context.Args()[0] == envCmd {
|
||||
// simply report the logging setup
|
||||
ignoreLogging = true
|
||||
|
Loading…
Reference in New Issue
Block a user