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

BrowserLogger: Use Console API functions for logs without data #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ansiwen
Copy link

@ansiwen ansiwen commented Jul 15, 2020

The Console API of browsers offer several functions for logs of
different severity levels, like error, warn, info, debug. This change
uses these functions instead of groupCollapsed for simple logs without data.
This allows to filter for logs in the browser console and allows the
browser to automatically group repeating logs.

Fixes: #17, #18

Signed-off-by: Sven Anderson [email protected]

The Console API of browsers offer several functions for logs of
different severity levels, like error, warn, info, debug. This change
uses these functions instead of groupCollapsed for simple logs without data.
This allows to filter for logs in the browser console and allows the
browser to automatically group repeating logs.

Fixes: shakacode#17, shakacode#18

Signed-off-by: Sven Anderson <[email protected]>
@alex35mil
Copy link
Member

Hey, sorry, I totally missed your PR. I didn't use these APIs b/c it introduces inconsistent behavior between loggers with and without data. I.e. if user logs 2 entries: one with data and one without and applies filter, only one entry gets hidden which is confusing. So I decided that consistency and predictability is more important than more feature-rich but inconsistent functionality.

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

Successfully merging this pull request may close these issues.

Use of console.group prevents grouping of similar logs
2 participants