-
-
Notifications
You must be signed in to change notification settings - Fork 161
feat: v2 hierarchical categories #205
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
feat: v2 hierarchical categories #205
Conversation
7a8e05b to
6bac8ea
Compare
lib/loglevel.js
Outdated
| return defaultLevel; | ||
| } else { | ||
| return inheritedLevel; | ||
| if (userLevel !== null) { |
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.
This fixes a bug where user level 0 wasn't applying.
lib/loglevel.js
Outdated
| * @type {number} | ||
| */ | ||
| var inheritedLevel; | ||
| var inheritedLevel = null; |
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.
These null changes fix a bug causing the levels to not apply correctly.
…to feat/v2-hierarchical-categories
|
@pimterry - I added the hierarchical loggers and the |
pimterry
left a comment
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.
I've added quite a few comments. This is a great start but there's a few ways we can simplify this. I've tried to cover the main points here so you get an idea - the main thing is that I don't think we need also the extra fields and edge cases.
Mr0grog
left a comment
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.
I don’t want to step on @pimterry’s toes in this review — these are just a few minor notes about syntax and public/private stuff.
|
@pimterry @Mr0grog
It needs docs updated, but I'm not going to complete that until the code is approved, then I will change just the docs. |
pimterry
left a comment
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.
Nice work @wayfarer3130! I like the approach. A couple more comments but just on small details now, I think this is nearly there.
There are other details we could tweak, but we can fix those up later (I agree the indentation is currently a mess for example, we should standardize on something there - personally I'd lean to 4 spaces everywhere but whatever people prefer).
This is mergeable though imo once the two loggers API details here are covered and the exports changes are pulled out.
|
Made the changes you requested |
|
Nice stuff, thanks @wayfarer3130! Merged 👍 |
Add hierarchical categories in loglevel v2