clean up the logging code

add limit writecloser, add closer method so we can flush logs properly,
buffer logs and stuff

it builds it works amirite
This commit is contained in:
Reed Allman
2017-06-11 17:36:45 -07:00
parent 24a90ad658
commit a0ec3024fd
3 changed files with 60 additions and 28 deletions

View File

@@ -173,6 +173,7 @@ func (r *Runner) run(ctx context.Context, cfg *task.Config) (drivers.RunResult,
}
cfg.Stderr = r.flog.Writer(ctx, cfg.AppName, cfg.Path, cfg.Image, cfg.ID)
defer cfg.Stderr.Close() // TODO we should prob log this err but hey
if cfg.Stdout == nil {
cfg.Stdout = cfg.Stderr
}