Don't reset the stored log level to default when it's TRACE#35
Don't reset the stored log level to default when it's TRACE#35pimterry merged 3 commits intopimterry:masterfrom
Conversation
|
Fix looks fine itself, but the tests don't pass; could you take a look at that? If you've got node + npm installed, you should be able to go: and have it run the lot of them headlessly (which should then fail, as in travis). If you run It'd be good to also add a new test to cover this case directly too. |
|
Ah, silly me! This fixes the failing tests and adds new tests covering my change. One thing that's a bit unhelpful is that when an error is thrown while loading the persisted log level, it ends up going through the requirejs error handler, which produces an incredibly unhelpful error message and stack trace: |
Fix bug where log level is reset to default if it's stored as TRACE
|
Good stuff, merged, thanks! Yeah, that's pretty bad as errors go. Looks like that's from whichever Jasmine/RequireJS template I'm using, I forget now, but I might take a look at fixing that over there pretty soon. |
At the moment, if you set the log level to TRACE, loadPersistedLevel() will set the log level back to WARN (since self.levels[storedLevel] will be 0 which is falsey). This fixes that in at least Chrome, I'm not sure where else to test it.