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

chore(ui): introduce a logger proxy - WF-85 #704

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

madeindjs
Copy link
Collaborator

Introduce a simple abstraction to use logger in the application. For the moment, it's just a proxy to console, but it can be plugged to any library later. It's also a good way to prevent that logs are not displayed in the tests.

@madeindjs madeindjs self-assigned this Dec 18, 2024
Introduce a simple abstraction to use logger in the application. For the moment, it's just a proxy to `console`, but it can be plugged to any library later. It's also a good way to prevent that logs are not displayed in the tests.
/**
* A simple abstraction to use logger in the application. For the moment, it's just a proxy to `console`, but it can be plugged to any library later.
*/
export function useLogger(): Pick<
Copy link
Collaborator

Choose a reason for hiding this comment

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

What the interest of using a hook syntax here and not use a function as ?

logger.log("my logger")

instead of

useLogger().log()

@ramedina86 ramedina86 merged commit 54623ff into writer:dev Jan 7, 2025
16 checks passed
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.

3 participants