Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(logger) added logger to be passed through the sagas #86

Merged
merged 3 commits into from
Jun 12, 2019

Conversation

vladshub
Copy link
Contributor

@vladshub vladshub commented Jun 11, 2019

Closes issue #87

@vladshub vladshub requested review from avigailberger and rhinof and removed request for avigailberger June 11, 2019 12:00
gbus/bus.go Outdated
@@ -36,6 +37,7 @@ type DefaultBus struct {
amqpErrors chan *amqp.Error
amqpBlocks chan amqp.Blocking
Registrations []*Registration
logger logrus.FieldLogger
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not critical but I think "log" would be read better
b.log().WithFields(...).Error(...)
vs
b.logger().WithFields(...).Error(...)

@@ -185,6 +187,7 @@ type Invocation interface {
Bus() Messaging
Tx() *sql.Tx
Ctx() context.Context
Logger() logrus.FieldLogger
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure whether we should expose the package specific implementation(logrus) in the interface used by handlers...what would be the migration path if we decide to move away from logrus in future releases?

@@ -190,7 +190,9 @@ func (imsm *Glue) invokeSagaInstance(instance *Instance, invocation gbus.Invocat
inboundMsg: message,
sagaID: instance.ID,
ctx: invocation.Ctx(),
invokingService: imsm.svcName}
invokingService: imsm.svcName,
logger: imsm.log().WithField("saga_id", instance.ID),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add the type of the saga and maybe the type/message fqn that invokes the saga instance as fields as well

@rhinof
Copy link
Contributor

rhinof commented Jun 11, 2019

Need to rebase this PR and merge it to the v1.x branch and not master

@rhinof
Copy link
Contributor

rhinof commented Jun 11, 2019

In addition, let's open an issue for this and associate the PR with it so we don't leave this out in the next release notes

@coveralls
Copy link

coveralls commented Jun 11, 2019

Coverage Status

Coverage increased (+0.4%) to 73.719% when pulling 8963173 on feat-invocation-logger into d9fb80f on v1.x.

@vladshub vladshub changed the base branch from master to v1.x June 11, 2019 14:51
@rhinof rhinof merged commit eeb2935 into v1.x Jun 12, 2019
@rhinof rhinof deleted the feat-invocation-logger branch June 12, 2019 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants