Support for logging from children processes

Add support for children processes logging (including nsexec).
A pipe is used to send logs from children to parent in JSON.
The JSON format used is the same used by logrus JSON formatted,
i.e. children process can use standard logrus APIs.

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
This commit is contained in:
Marco Vedovati
2018-08-03 19:11:20 +02:00
committed by Danail Branekov
parent 029124da7a
commit 9a599f62fb
9 changed files with 257 additions and 6 deletions
+6
View File
@@ -133,6 +133,12 @@ func main() {
updateCommand,
}
app.Before = func(context *cli.Context) error {
// do nothing if logrus was already initialized in init.go
if logrus.StandardLogger().Out != logrus.New().Out {
return nil
}
if context.GlobalBool("debug") {
logrus.SetLevel(logrus.DebugLevel)
}