diff --git a/packages/amplify_core/lib/src/category/amplify_logging_category.dart b/packages/amplify_core/lib/src/category/amplify_logging_category.dart index b64714987f..ef55e5d945 100644 --- a/packages/amplify_core/lib/src/category/amplify_logging_category.dart +++ b/packages/amplify_core/lib/src/category/amplify_logging_category.dart @@ -61,6 +61,9 @@ class LoggingCategory extends AmplifyCategory { /// Sends recorded logs to the output and remove them from the local storage. /// {@endtemplate} void flushLogs() { - return defaultPlugin.flushLogs(); + return identifyCall( + LoggingCategoryMethod.flush, + () => defaultPlugin.flushLogs(), + ); } } diff --git a/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/cloudwatch_logger_plugin.dart b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/cloudwatch_logger_plugin.dart index 1b03df8949..49b7f09715 100644 --- a/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/cloudwatch_logger_plugin.dart +++ b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/cloudwatch_logger_plugin.dart @@ -389,10 +389,7 @@ class CloudWatchLoggerPlugin extends AWSLoggerPlugin /// Sends logs on-demand to CloudWatch. Future flushLogs() async { - await identifyCall( - LoggingCategoryMethod.flush, - _startSyncingIfNotInProgress, - ); + await _startSyncingIfNotInProgress(); } @override