rgst-io / stencil

📒 A modern living-template engine for evolving repositories
https://stencil.rgst.io
Apache License 2.0
4 stars 1 forks source link

feat: add slogext package and switch to use it #69

Closed jaredallard closed 1 month ago

jaredallard commented 1 month ago

This commit adds a slogext package with the purpose of providing a generic logging package, powered by slog^1, with charm/log^2 as the underlying handler. This enables us to have an easier time switching logging libraries out if we ever need to do so again.

I also added the notion of a test logger that will enable us to do test specific things if we so desire (e.g., pipe to t.Log, automatic test.name setting, etc.). I switched all tests to use this.

Misc changes made:

Before

Screenshot 2024-05-29 at 16 03 59 Screenshot 2024-05-29 at 16 04 18

After

Screenshot 2024-05-29 at 16 03 21 Screenshot 2024-05-29 at 16 05 05
cloudflare-pages[bot] commented 1 month ago

Deploying stencil with  Cloudflare Pages  Cloudflare Pages

Latest commit: a95d4e7
Status: âœ…  Deploy successful!
Preview URL: https://662538d9.stencil-1wj.pages.dev
Branch Preview URL: https://jaredallard-feat-slog.stencil-1wj.pages.dev

View logs

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 58.20896% with 28 lines in your changes are missing coverage. Please review. Files Patch % Lines
internal/codegen/tpl_stencil.go 28.57% 10 Missing :warning:
internal/slogext/slogext.go 76.47% 4 Missing :warning:
cmd/stencil/stencil.go 0.00% 3 Missing :warning:
internal/codegen/stencil.go 60.00% 2 Missing :warning:
pkg/extensions/apiv1/server.go 0.00% 2 Missing :warning:
pkg/stenciltest/stenciltest.go 50.00% 1 Missing and 1 partial :warning:
internal/cmd/stencil/stencil.go 50.00% 1 Missing :warning:
internal/codegen/tpl_file.go 0.00% 1 Missing :warning:
internal/modules/module.go 0.00% 1 Missing :warning:
pkg/extensions/apiv1/rpc_transport_server.go 0.00% 1 Missing :warning:
... and 1 more

:loudspeaker: Thoughts on this report? Let us know!