Commit 44166efa authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent cb33662b
...@@ -28,7 +28,7 @@ import ( ...@@ -28,7 +28,7 @@ import (
taskctx "lab.nexedi.com/kirr/neo/go/internal/xcontext/task" taskctx "lab.nexedi.com/kirr/neo/go/internal/xcontext/task"
) )
// Running is syntactic sugar to push new task to operational stack, log it and // Running is syntactic sugar to push new task to operational stack, trace it and
// adjust error return with task prefix. // adjust error return with task prefix.
// //
// use like this: // use like this:
...@@ -46,14 +46,14 @@ func Runningf(ctxp *context.Context, format string, argv ...interface{}) func(*e ...@@ -46,14 +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, "[") // XXX log -> trace, don't put ":" before "[" log.Depth(2).Info(ctx, "[") // TODO log -> trace, don't put ":" before "["
return func(errp *error) { return func(errp *error) {
err := "" err := ""
if e := *errp; e != nil { if e := *errp; e != nil {
err = fmt.Sprintf(" (%s)", e) err = fmt.Sprintf(" (%s)", e)
} }
log.Depth(1).Info(ctx, "]"+err) // XXX log -> trace, don't put ":" before "]" log.Depth(1).Info(ctx, "]"+err) // TODO 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