Skip to content

feature(slog): support slog logger#37

Open
alekseykondratev91 wants to merge 1 commit into
hanagantig:mainfrom
alekseykondratev91:use-slog
Open

feature(slog): support slog logger#37
alekseykondratev91 wants to merge 1 commit into
hanagantig:mainfrom
alekseykondratev91:use-slog

Conversation

@alekseykondratev91

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

Comment thread internal/config/logger.go
@@ -0,0 +1,48 @@
package config

Copy link
Copy Markdown
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