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

Will loglevel support module logging #37

Closed
shihshen opened this issue Dec 25, 2013 · 2 comments
Closed

Will loglevel support module logging #37

shihshen opened this issue Dec 25, 2013 · 2 comments

Comments

@shihshen
Copy link

Hi Tim,
I am wondering if loglevel plan to support module logging like:
https://github.com/dingyonglaw/JSLog

Powpow.

@pimterry
Copy link
Owner

Probably not, I'm afraid, no. For a few reasons:

  • It's not something I think you really need in smaller applications, and adding logging for seriously big heavy-duty apps is not something loglevel is focusing on. Loglevel's a quick lightweight convenient solution, rather than a heavyweight kitchen-sink lib with every useful feature anybody can think of.
  • It's impossible to do without clobbering your stack traces; we currently just use bound console.X methods as properties on the log object (where possible), so loglevel doesn't run any code when you're logging, and your console output will show you exactly where the logging occurred. We can't do this if we also have to add any behaviour that occurs whenever a log method is called (as here).
  • The binding methods above means that in modern browsers you already get a specific file & line number that the message came from in the console, and if you're sensibly broken your modules into individual files this will give you equivalent information to what you're looking for anyway, I suspect.

Sorry about that. Does that all make sense?

@shihshen
Copy link
Author

I think your consideration is very reasonable. It's true that if you want to make loglevel very lightweight. Just want to confirm. Thank you for replying, Tim.

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

No branches or pull requests

2 participants