feat(sprigin): allow custom logger to be pass to sprigin#170
feat(sprigin): allow custom logger to be pass to sprigin#170
Conversation
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
|
Comments addressed, thanks for your time @ccoVeille 🙏 |
| t.Run("works without options", func(t *testing.T) { | ||
| funcMap := FuncMap() | ||
|
|
||
| assert.NotNil(t, funcMap) | ||
| }) |
There was a problem hiding this comment.
By reading only the PR (not only this test), and not the rest if the code, I'm a but surprised by the apparent simplicity of the tests here.
Is there any case when FuncMap will return something that is not nil?
I mean I feel like there is something strange with either FuncMap signature or the way you test it.
If your test is only there to validate the function signature. You don't need testify.
Also, here this test sounds strange. Why is the TestWithLogger testing something that is not using WithLogger it's about FuncMap
| customLogger := slog.New(slog.NewTextHandler(&buf, nil)) | ||
|
|
||
| funcMap := FuncMap(WithLogger(customLogger)) | ||
|
|
||
| assert.NotNil(t, funcMap) |
There was a problem hiding this comment.
See other comment, this is not a test.
If you wanted a test, you should check something like funcMap contains/can use the custom logger
Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com> Signed-off-by: Atomys <contact@atomys.fr>
Description
This PR allow user of sprigin to use a custom logger to link sprigin errors to internal logging system.
Changes
Fixes #168
Checklist