rescript-logger icon indicating copy to clipboard operation
rescript-logger copied to clipboard

BrowserLogger: Use Console API functions for logs without data

Open ansiwen opened this issue 5 years ago • 1 comments

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]

ansiwen avatar Jul 15 '20 23:07 ansiwen

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.

alex35mil avatar Sep 07 '20 10:09 alex35mil