error method
Future<void>
error(
- Object exception,
- StackTrace? stackTrace, {
- String? name,
- DynamicMap? parameters,
Report exception and stackTrace caught by try-catch.
Adapters that can handle errors natively should override this to report them as errors.
By default it falls back to send with the log name name (error if not specified).
try-catchでキャッチしたexceptionとstackTraceを報告します。
エラーをネイティブに扱えるアダプターはこれをオーバーライドしてエラーとして報告してください。
既定ではログ名name(未指定の場合はerror)でsendにフォールバックします。
Implementation
Future<void> error(
Object exception,
StackTrace? stackTrace, {
String? name,
DynamicMap? parameters,
}) async {
await send(
name ?? "error",
parameters: {
...?parameters,
"error": exception.toString(),
"stackTrace": stackTrace?.toString(),
},
);
}