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

Fix Deprecated FX Logger, Add Zap Logging #107

Closed
4 tasks
renaz6 opened this issue Sep 21, 2022 · 0 comments · Fixed by #124
Closed
4 tasks

Fix Deprecated FX Logger, Add Zap Logging #107

renaz6 opened this issue Sep 21, 2022 · 0 comments · Fixed by #124
Assignees
Labels
bug Something isn't working

Comments

@renaz6
Copy link
Member

renaz6 commented Sep 21, 2022

fx.Logger(printer) has been deprecated and is causing unit tests to fail in Themis. We should refactor Themis to use Zap logging (https://pkg.go.dev/go.uber.org/zap) and the WithLogger(constructor) method (https://pkg.go.dev/go.uber.org/fx#WithLogger).

themis/xlog/printer.go

Lines 117 to 132 in 77da3c8

func Logger() fx.Option {
bp := new(BufferedPrinter)
return fx.Options(
fx.Logger(bp),
fx.Provide(
func(lc fx.Lifecycle) *BufferedPrinter {
lc.Append(fx.Hook{
OnStart: bp.OnStart,
})
return bp
},
),
fx.ErrorHook(bp),
)
}

To Do:

  • Refactor Themis to use Zap
  • Update printer.go to use zap and WithLogger
  • Add back the commented out unit test in printer_test.go and run
  • Update and fix unit tests

Helpful Links:

@renaz6 renaz6 added the bug Something isn't working label Sep 21, 2022
@renaz6 renaz6 self-assigned this Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant