beaver-logger
beaver-logger copied to clipboard
Add disableBrowserLogging option #28
Hello,
From the issue #28, someone asked if it was possible to have an option to disable logs appearing in the browser console.
Option
| option | type | default value |
|---|---|---|
| disableBrowserLogging | boolean | false |
This option will disable the function print to be executed internally and will not print the logs in the browser console.
Usage
const $logger = Logger({
url: '/test/api/log',
disableBrowserLogging: true
});
@mnicpt @bluepnume can you take a look at ^^?
Yes. @musps I think disableBrowserLogging would be a better name since it's already enabled. Can you update this?
@musps Can you revert the /dist changes. This will happen automatically when we publish.
@mnicpt Both are done!
any chance to release this enhancement soon?
Thank you! looking forward for this PR to be merged as well!
One note, though, if it's not too much trouble I think it makes for a better API to have a browser log level instead of a flag. For our needs, for instance, it would be preferable to have only errors emitted to console and everything allowed by logLevel sent to BE. I guess this is not such a rare use case for other users as well.
You may even want to add a level above error (SUPPRESS? IGNORE?) which will cover the 'complete disable' use case, instead of another argument.
If required (provided you approve of this direction) I think I can make this change, building off @musps great work