Skip to content

Commit

Permalink
chore: Update Amplify CloudWatchLoggerPlugin to
Browse files Browse the repository at this point in the history
AmplifyLoggingCloudwatch
  • Loading branch information
khatruong2009 committed Nov 17, 2023
1 parent 4b626b0 commit 5964089
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class _MyAppState extends State<MyApp> {
MacOSSecureStorageOptions(useDataProtection: false),
),
);
final loggingPlugin = AmplifyCloudWatchLoggerPlugin(
final loggingPlugin = AmplifyLoggingCloudwatch(
CloudWatchPluginConfig.fromJson(
jsonDecode(loggingconfig) as Map<String, dynamic>,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import 'package:amplify_logging_cloudwatch/src/path_provider/flutter_path_provid
import 'package:amplify_logging_cloudwatch_dart/amplify_logging_cloudwatch_dart.dart';

/// {@macro amplify_logging_cloudwatch_dart.cloudwatch_logger_plugin}
class AmplifyCloudWatchLoggerPlugin extends CloudWatchLoggerPlugin {
class AmplifyLoggingCloudwatch extends AmplifyLoggingCloudWatchDart {
/// {@macro amplify_logging_cloudwatch_dart.cloudwatch_logger_plugin}
AmplifyCloudWatchLoggerPlugin(
AmplifyLoggingCloudwatch(
super.pluginConfig, {
super.remoteLoggingConstraintProvider,
FutureOr<String> Function()? logStreamNameProvider,
Expand All @@ -31,14 +31,14 @@ class AmplifyCloudWatchLoggerPlugin extends CloudWatchLoggerPlugin {
/// A plugin key which can be used with `Amplify.Logging.getPlugin` to retrieve
/// a CloudWatch-specific Logging category interface.
/// {@endtemplate}
static const LoggingPluginKey<AmplifyCloudWatchLoggerPlugin> pluginKey =
static const LoggingPluginKey<AmplifyLoggingCloudwatch> pluginKey =
_AmplifyCloudWatchLoggerPluginKey();
}

class _AmplifyCloudWatchLoggerPluginKey
extends LoggingPluginKey<AmplifyCloudWatchLoggerPlugin> {
extends LoggingPluginKey<AmplifyLoggingCloudwatch> {
const _AmplifyCloudWatchLoggerPluginKey();

@override
String get runtimeTypeName => 'AmplifyCloudWatchLoggerPluginKey';
String get runtimeTypeName => 'AmplifyLoggingCloudwatchKey';
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ typedef _LogBatch = (List<QueuedItem> logQueues, List<InputLogEvent> logEvents);
/// {@template amplify_logging_cloudwatch_dart_dart.cloudwatch_logger_plugin}
/// An [AWSLoggerPlugin] for sending logs to AWS CloudWatch Logs.
/// {@endtemplate}
class CloudWatchLoggerPlugin extends LoggingPluginInterface with AWSDebuggable {
class AmplifyLoggingCloudWatchDart extends LoggingPluginInterface with AWSDebuggable {
/// {@macro amplify_logging_cloudwatch_dart.cloudwatch_logger_plugin}
CloudWatchLoggerPlugin(
AmplifyLoggingCloudWatchDart(
CloudWatchPluginConfig pluginConfig, {
RemoteLoggingConstraintProvider? remoteLoggingConstraintProvider,
FutureOr<String> Function()? logStreamNameProvider,
Expand Down Expand Up @@ -428,22 +428,22 @@ class CloudWatchLoggerPlugin extends LoggingPluginInterface with AWSDebuggable {
}

@override
String get runtimeTypeName => 'CloudWatchLoggerPlugin';
String get runtimeTypeName => 'AmplifyLoggingCloudWatchDart';

/// {@template amplify_logging_cloudwatch_dart.plugin_key}
/// A plugin key which can be used with `Amplify.Logging.getPlugin` to retrieve
/// a CloudWatch-specific Logging category interface.
/// {@endtemplate}
static const LoggingPluginKey<CloudWatchLoggerPlugin> pluginKey =
static const LoggingPluginKey<AmplifyLoggingCloudWatchDart> pluginKey =
_CloudWatchLoggerPluginKey();
}

class _CloudWatchLoggerPluginKey
extends LoggingPluginKey<CloudWatchLoggerPlugin> {
extends LoggingPluginKey<AmplifyLoggingCloudWatchDart> {
const _CloudWatchLoggerPluginKey();

@override
String get runtimeTypeName => 'CloudWatchLoggerPluginPluginKey';
String get runtimeTypeName => 'AmplifyLoggingCloudWatchDartKey';
}

extension on QueuedItem {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ void main() {
late MockCloudWatchLogsClient mockCloudWatchLogsClient;
late MockQueuedItemStore mockQueuedItemStore;
late MockCloudWatchLogStreamProvider mockCloudWatchLogStreamProvider;
late CloudWatchLoggerPlugin plugin;
late AmplifyLoggingCloudWatchDart plugin;
late MockSmithyOperation<PutLogEventsResponse> mockPutLogEventsOperation;
late DependencyManager dependencyManagerOverride;
late MockAuthProviderRepo mockAuthProviderRepo;
Expand Down Expand Up @@ -93,7 +93,7 @@ void main() {
.getAuthProvider(APIAuthorizationType.iam.authProviderToken),
).thenReturn(mockIamAuthProvider);

plugin = CloudWatchLoggerPlugin(
plugin = AmplifyLoggingCloudWatchDart(
pluginConfig,
dependencyManagerOverride: dependencyManagerOverride,
);
Expand Down

0 comments on commit 5964089

Please sign in to comment.