Commit fce7640c authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 85fdae69
...@@ -46,20 +46,14 @@ func Runningf(ctxp *context.Context, format string, argv ...interface{}) func(*e ...@@ -46,20 +46,14 @@ func Runningf(ctxp *context.Context, format string, argv ...interface{}) func(*e
func running(ctxp *context.Context, name string) func(*error) { func running(ctxp *context.Context, name string) func(*error) {
ctx := taskctx.Running(*ctxp, name) ctx := taskctx.Running(*ctxp, name)
*ctxp = ctx *ctxp = ctx
log.Depth(2).Info(ctx, "start") // XXX log -> trace log.Depth(2).Info(ctx, "[") // XXX log -> trace, don't put ":" before "["
return func(errp *error) { return func(errp *error) {
if *errp != nil { err := ""
// XXX is it good idea to log to error here? (not in above layer) if e := *errp; e != nil {
// XXX what is error here could be not so error above err = fmt.Sprintf(" (%s)", e)
// XXX or we still want to log all errors - right?
//
// -> yes, we do want to trace unconditionally when a task is finished
// here it is tracing, just with trace sink being hardcoded to log.
log.Depth(1).Warning(ctx, "## ", *errp) // XXX "##" temp
} else {
log.Depth(1).Info(ctx, "done")
} }
log.Depth(1).Info(ctx, "]" + err) // XXX log -> trace, don't put ":" before "]"
// NOTE not *ctxp here - as context pointed by ctxp could be // NOTE not *ctxp here - as context pointed by ctxp could be
// changed when this deferred function is run // changed when this deferred function is run
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment