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

Update logging #1072

Merged
merged 10 commits into from
Jun 21, 2023
Merged

Update logging #1072

merged 10 commits into from
Jun 21, 2023

Conversation

kuzdogan
Copy link
Member

@kuzdogan kuzdogan commented Jun 20, 2023

View in Huly HI-550

@kuzdogan kuzdogan requested a review from marcocastignoli June 20, 2023 16:06
@codecov-commenter
Copy link

codecov-commenter commented Jun 20, 2023

Codecov Report

Patch coverage: 68.18% and project coverage change: -4.24 ⚠️

Comparison is base (b22dfab) 78.90% compared to head (302adae) 74.66%.

Additional details and impacted files
@@             Coverage Diff             @@
##           staging    #1072      +/-   ##
===========================================
- Coverage    78.90%   74.66%   -4.24%     
===========================================
  Files           57       64       +7     
  Lines         1536     2333     +797     
  Branches       266      431     +165     
===========================================
+ Hits          1212     1742     +530     
- Misses         189      366     +177     
- Partials       135      225      +90     
Flag Coverage Δ
lib-sourcify 66.34% <ø> (?)
server 79.20% <68.18%> (+0.29%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ommon/SourcifyEventManager/SourcifyEventManager.ts 100.00% <ø> (ø)
...rc/common/SourcifyEventManager/listeners/logger.ts 100.00% <ø> (ø)
src/monitor/pending-contract.ts 82.60% <ø> (+1.75%) ⬆️
src/server/middlewares/GenericErrorHandler.ts 66.66% <ø> (ø)
src/server/services/VerificationService.ts 66.66% <ø> (+1.96%) ⬆️
src/config.ts 59.09% <50.00%> (ø)
src/server/server.ts 81.72% <50.00%> (-0.58%) ⬇️
src/sourcify-chains.ts 83.67% <50.00%> (+0.16%) ⬆️
src/monitor/monitor.ts 82.67% <60.00%> (+4.10%) ⬆️
src/monitor/source-fetcher.ts 84.25% <80.00%> (-3.02%) ⬇️
... and 1 more

... and 11 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@marcocastignoli marcocastignoli left a comment

Choose a reason for hiding this comment

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

Looks good to me, the only doubt that I have is about using directly the logger just for the debug. Couldn't we create a specific event for debugging? Just for the purpose of always passing through the EventManager?

@kuzdogan
Copy link
Member Author

Looks good to me, the only doubt that I have is about using directly the logger just for the debug. Couldn't we create a specific event for debugging? Just for the purpose of always passing through the EventManager?

I'm still not completely sure about using the EventManager. I tried for instance using the events in the monitor tests for example with SourcifyEventManager.on("Monitor.Verified") but couldn't make it work here. Maybe I missed something.

sourcify/test/monitor.js

Lines 193 to 197 in 302adae

monitorWrapper.on("contract-verified-successfully", () => {
monitorWrapper.assertFilesStored(address, contractWrapper);
monitorWrapper.stop();
done();
});

I don't have a full grasp of Events in node but felt like the modules themselves (monitor etc.) emitting events is more sensible.

Still we don't have to decide on this now and just get the job done for now.

@kuzdogan kuzdogan merged commit 6a5dd4c into staging Jun 21, 2023
@kuzdogan kuzdogan deleted the logging branch December 19, 2023 18:22
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.

3 participants