feat(util-invariant): Convert to use util-logger under the hood#2418
feat(util-invariant): Convert to use util-logger under the hood#2418lanceherman wants to merge 8 commits intoonflow:masterfrom
Conversation
…` and add optional logger level parameter. Update package dependencies to include `@onflow/util-logger`.
|
|
Hey @chasefleming could you review the changes and check if everything's alright. Thanks. |
|
Hi @jribbink, thanks for the review! The optional loggerLevel parameter was actually one of the specific requirements by @chasefleming in the original issue (#1488). From the issue description: If syntax is the same, then default to util logger throwing an error That's why I implemented it this way: By default (no logger level specified), it behaves exactly as before - throwing errors |
Co-authored-by: Jordan Ribbink <17958158+jribbink@users.noreply.github.com>
|
hey @jribbink could you please review the changes. |
|
hey @jribbink if you have time, please could you check if everything's alright |
| logger.log({ | ||
| title: "Invariant Violation", | ||
| message: `${error.message}\n${rest.length ? "\nDetails:" + JSON.stringify(rest, null, 2) : ""}`, | ||
| level: loggerLevel |
There was a problem hiding this comment.
loggerLevel is not defined, this should just always be set to logger.LEVELS.error
Description
This PR addresses issue #1488 by converting the
util-invariantpackage to useutil-loggerunder the hood instead of directconsole.errorcalls.Changes
util-invariantto useutil-loggerfor logging@onflow/util-loggeras a dependencyon-message-from-fcl.jsImplementation Details
Testing
The changes maintain the existing functionality while adding the ability to:
Fixes #1488