simc / logger

Small, easy to use and extensible logger which prints beautiful logs.
https://pub.dev/packages/logger
MIT License
1.07k stars 129 forks source link

Why is StackTrace null-safe? #93

Open caseyryan opened 3 years ago

caseyryan commented 3 years ago

The standard

try {
...
}
catch (e, s) {
 logger.e(e, s);
}

now throws Error: Invalid argument(s): Error parameter cannot take a StackTrace! at Object.throw_ [as throw] (http://localhost:5555/dart_sdk.js:5032:11) at logger.Logger.new.log (http://localhost:5555/packages/logger/src/log_filter.dart.lib.js:668:19)

Because dart throws StackTrace, not StackTrace?

narumi147 commented 3 years ago

You just missing message param, logger.e('msg',e,s). And ! here is not a null-check operator, just an usual exclamation mark.