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

Add module info to fxevent #863

Merged
merged 3 commits into from Mar 23, 2022
Merged

Add module info to fxevent #863

merged 3 commits into from Mar 23, 2022

Conversation

sywhang
Copy link
Contributor

@sywhang sywhang commented Mar 22, 2022

This adds the module info in the fxevent Provided/Decorated/Invoked
structs to make the logs more descriptive by including which module
each of these happened from.

This can be helpful especially for debugging decorates, since the
module from which decoration is applied changes the results.

Fix #855.
Refs GO-1285.

This adds the module info in the fxevent Provided/Decorated/Invoked
structs to make the logs more descriptive by including which module
each of these happened from.

This can be helpful especially for debugging decorates, since the
module from which decoration is applied changes the results.
@codecov
Copy link

codecov bot commented Mar 22, 2022

Codecov Report

Merging #863 (f0fb201) into master (24f6f50) will increase coverage by 0.04%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #863      +/-   ##
==========================================
+ Coverage   98.45%   98.49%   +0.04%     
==========================================
  Files          30       30              
  Lines        1100     1130      +30     
==========================================
+ Hits         1083     1113      +30     
  Misses         11       11              
  Partials        6        6              
Impacted Files Coverage Δ
fxevent/event.go 100.00% <ø> (ø)
fxevent/console.go 100.00% <100.00%> (ø)
fxevent/zap.go 100.00% <100.00%> (ø)
module.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 24f6f50...f0fb201. Read the comment docs.

Copy link
Collaborator

@abhinav abhinav left a comment

Choose a reason for hiding this comment

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

some suggestions

fxevent/console.go Outdated Show resolved Hide resolved
fxevent/console_test.go Outdated Show resolved Hide resolved
fxevent/zap_test.go Outdated Show resolved Hide resolved
@sywhang sywhang merged commit 99425a8 into uber-go:master Mar 23, 2022
@sywhang sywhang deleted the logging-module branch March 23, 2022 17:21
jkanywhere added a commit to jkanywhere/fx that referenced this pull request May 4, 2022
Fix the format call for `Supplied` event.

Previously, `\n%!(EXTRA string=)` was appended to `SUPPLY` logs when
`ModuleName` was empty.

Add tests to ensure format string contains the same number of verbs as
there are arguments when logging an `Event` using `ConsoleLogger` for
all relevant event types,

Module info was added to fxevent in uber-go#863.
sywhang pushed a commit that referenced this pull request May 4, 2022
Fix the format call for `Supplied` event.

Previously, `\n%!(EXTRA string=)` was appended to `SUPPLY` logs when
`ModuleName` was empty.

Add tests to ensure format string contains the same number of verbs as
there are arguments when logging an `Event` using `ConsoleLogger` for
all relevant event types,

Module info was added to fxevent in #863.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Logging for Provided/Decorated/Invoked should include Module info
2 participants