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

feature(slog): support slog logger #37

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alekseykondratev91
Copy link
Contributor

  • add chunk zap and slog
  • add struct logger in config
  • add field logger in goro.yaml
  • add validation supported loggers
  • refactor template files

* add chunk zap and slog
* add struct logger in config
* add field logger in goro.yaml
* add validation supported loggers
* refactor template files
func NewLogger() (*zap.Logger, error) {
return zap.NewProduction()
func NewLogger() *slog.Logger {
handler := slog.NewJSONHandler(os.Stdout, nil)
Copy link
Owner

Choose a reason for hiding this comment

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

it's good to add here some default fields, such as env=production, app=goro, version=0.0.1

@@ -0,0 +1,33 @@
package slogchunk
Copy link
Owner

Choose a reason for hiding this comment

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

Let's keep only slog implementation in the generated code. Basically we will use slog everywhere and if somebody want to use different loggers - they will just implement their own handler for the slog

@@ -0,0 +1,48 @@
package config
Copy link
Owner

Choose a reason for hiding this comment

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

no needs in all of this thing since we will keep only slog implementation in our code (check this comment )

@inneroot inneroot mentioned this pull request Mar 4, 2024
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.

2 participants