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

Simplify internal logger resolution #14

Open
medikoo opened this issue Sep 2, 2019 · 0 comments
Open

Simplify internal logger resolution #14

medikoo opened this issue Sep 2, 2019 · 0 comments
Assignees

Comments

@medikoo
Copy link
Owner

medikoo commented Sep 2, 2019

While there's nothing much sophisticated in logger resolution logic, it's kinda magical and internally requires changes to object prototypes. That is not typical, and makes implementation more convulted and not that portable to ES3 enviroments (altough it's not clear yet, whether there's value in doing that).

Update would make API usage more restrictive and also more straightforward:

  • info logs will have to be logged via log.info() (log will no longer be a function)
  • Access of other logger functions via logger function will not be possible (e.g.
log.debug.error('some error log');

will crash with undefined is not a function

  • Still we may consider to maintain a possibility to preload loggers as:
const log = log.debug; log('some debug log')`
@medikoo medikoo self-assigned this Sep 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant