-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
v2: First steps, drop old IE support, fix debug
#203
Conversation
As a first step for v2, this drops support for behaviors only needed with IE < 11: - A `console` object that appears asynchronously only after dev tools are opened. - Oddball `trace` behavior. - Missing `<function>.bind()` method.
For now, this keeps `log` as an alias for `debug`, since we don't currently have a separate `log` level. We may want to add one! Fixes pimterry#137.
Can you switch the target branch? |
Whoops, thought I'd done that! Thanks for catching. |
Looking back at this at the end of the day, I think I’ve changed my mind. The README has long made clear that the
So actually the way this PR is now is probably fine. The only change I might still suggest is making
But that’s not a strong opinion. The current level |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only change I might still suggest is making log an alias for info instead of debug in order to work more like browser dev tools
Yep, that makes sense for me! As in the README, this was intended just as a little convenience method, not as a separate level, and I think that matches normal levels elsewhere so I don't think we should make it an actual loglevel in itself. Aliasing to info seems reasonable though.
Happy to merge this now and leave it for a separate PR, or include it here if you prefer, up to you.
This matches browser behavior more closely (Chromium/Blink treats them the same; Webkit & Gecko put it between `info` and `warn`, so this is closer to their behavior than the old alias).
b66c353
to
9f1dcb5
Compare
@pimterry I went ahead and made that change, so feel free to merge. Re: the two issues you called out inline, please see my replies. Happy to make changes if you want. |
This is a very first step towards v2, based on discussion in #119. It just does two main things:
trace
handling, etc.debug
call through toconsole.debug
instead ofconsole.log
(fixes log.debug should map to console debug in Chrome #137).This does not:
log
, so I’ve left it as an alias fordebug
(it used to be the other way around). Should we add one? (I think yes.) Where does it sit in terms of levels? Precedent varies:info
(Chrome)debug
andinfo
(closest to Loglevel’s v1.x behavior)info
andwarn
(Safari & Firefox)I’d vote for “between
info
andwarn
” to match browsers as well as possible.Other options could include:
logger.log()
method at all)logger.log(level, ...messages)
)console.log
under the hood (right now it is the same level asdebug
, and also callsconsole.debug
). If we did this, maybe best to make it match theinfo
level (Since that is how Chrome treats it)?(Update: re-formatted all the stuff about
log()
to make it more clear.)