https://github.com/efectn/fx-zerolog
Zerolog adapter for uber-go/fx/fxevent.
https://github.com/efectn/fx-zerolog
Last synced: about 1 year ago
JSON representation
Zerolog adapter for uber-go/fx/fxevent.
- Host: GitHub
- URL: https://github.com/efectn/fx-zerolog
- Owner: efectn
- License: gpl-3.0
- Created: 2022-04-09T16:27:55.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-02-21T19:36:22.000Z (over 3 years ago)
- Last Synced: 2025-02-27T04:09:35.508Z (over 1 year ago)
- Language: Go
- Homepage:
- Size: 45.9 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Zerolog Adapter for Fx
[](https://pkg.go.dev/github.com/efectn/fx-zerolog)
Zerolog adapter for uber-go/fx/fxevent.
### Supported Go Versions
- 1.18
### Install
```shell
go get -u github.com/efectn/fx-zerolog@latest
```
### Example
```go
import (
"github.com/rs/zerolog"
"go.uber.org/fx"
"github.com/efectn/fx-zerolog"
)
// ...
func main() {
fx.New(
fx.Provide(
NewLogger,
NewConfig,
NewRouter,
),
fx.Invoke(Listen),
WithLogger(
fxzerolog.Init(),
),
)
}
```
### License
fx-zerolog is licensed under the terms of the **GPL-3 License** (see [LICENSE](LICENSE)).