Skip to content

Commit

Permalink
fix(logger:instance) now removing logging to stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
vladshub committed Jun 11, 2019
1 parent ddc9ba2 commit a56e8f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 0 additions & 1 deletion gbus/bus.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,6 @@ func (b *DefaultBus) GetHealth() HealthCard {
DbConnected: dbConnected,
RabbitBackPressure: b.backpressure,
RabbitConnected: b.amqpConnected,

}
}

Expand Down
12 changes: 7 additions & 5 deletions gbus/saga/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package saga
import (
"database/sql"
"fmt"
"log"
"github.com/sirupsen/logrus"
"reflect"
"time"

Expand Down Expand Up @@ -38,16 +38,18 @@ func (si *Instance) invoke(exchange, routingKey string, invocation gbus.Invocati
params := make([]reflect.Value, 0)
params = append(params, reflect.ValueOf(invocation), valueOfMessage)
method := reflectedVal.MethodByName(methodName)
log.Printf(" invoking method %v on saga instance %v", methodName, si.ID)
invocation.Log().WithFields(logrus.Fields{
"method_name": methodName, "saga_id": si.ID,
}).Info("invoking method on saga")
returns := method.Call(params)

val := returns[0]
if !val.IsNil() {
return val.Interface().(error)
}

log.Printf(" saga instance %v invoked", si.ID)

invocation.Log().WithFields(logrus.Fields{
"method_name": methodName, "saga_id": si.ID,
}).Info("saga instance invoked")
}

return nil
Expand Down

0 comments on commit a56e8f0

Please sign in to comment.