juno icon indicating copy to clipboard operation
juno copied to clipboard

Add logger interface

Open joshklop opened this issue 2 years ago • 3 comments

Description

Implement a logger interface and a Log struct that uses zap.SugaredLogger under the hood.

Note: this PR is not directly designed to make log messages more descriptive.

Changes:

  • Implement the logger interface and replace instances of *zap.SugaredLogger with the interface
  • Move internal/log to pkg/log

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (no functional changes, no api changes)

Testing

Requires testing: Yes

Did you write tests? Yes

Documentation

If this requires a documentation update, did you add one? Not required

joshklop avatar Sep 05 '22 13:09 joshklop

Codecov Report

Base: 92.84% // Head: 92.67% // Decreases project coverage by -0.17% :warning:

Coverage data is based on head (6c68f76) compared to base (c5cc557). Patch coverage: 62.96% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #393      +/-   ##
==========================================
- Coverage   92.84%   92.67%   -0.18%     
==========================================
  Files          67       67              
  Lines        7350     7368      +18     
==========================================
+ Hits         6824     6828       +4     
- Misses        519      532      +13     
- Partials        7        8       +1     
Flag Coverage Δ
unittests 92.67% <62.96%> (-0.18%) :arrow_down:

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

Impacted Files Coverage Δ
internal/juno/juno.go 100.00% <ø> (ø)
internal/metrics/prometheus/metrics.go 73.33% <ø> (ø)
internal/rpc/http.go 0.00% <0.00%> (ø)
internal/rpc/starknet/starknet.go 0.00% <0.00%> (ø)
internal/rpc/starknet/utils.go 24.13% <0.00%> (ø)
internal/sync/apiCollection.go 100.00% <ø> (ø)
internal/sync/l1Collector.go 100.00% <ø> (ø)
internal/sync/sync.go 100.00% <ø> (ø)
internal/sync/utils.go 100.00% <ø> (ø)
pkg/felt/felt.go 100.00% <ø> (ø)
... and 5 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov[bot] avatar Sep 05 '22 13:09 codecov[bot]

Thanks! Forgot to initialize the logger on the metrics server. It should be working now.

joshklop avatar Sep 05 '22 20:09 joshklop

That is by design. The logger is renamed here.

joshklop avatar Sep 06 '22 13:09 joshklop