log is a simple logrus helper to allow attaching a logrus.Entry to a context.Context.
// Create a ctx that carries a logrus.Entry with field "cmd" indicating the executable being run
ctx := log.WithField(ctx, "cmd", os.Args[0])
ctx = log.WithFields(ctx,WithFields(parent,
logrus.Fields{
"pid": os.Getpid(),
"uid": os.Getuid(),
},
)
// Log with the Entry from the ctx
log.Entry(ctx).Info("Informational log")