Skip to content

Commit

Permalink
Replace all logTyped methods with logCustom
Browse files Browse the repository at this point in the history
  • Loading branch information
Frezyx committed Nov 16, 2024
1 parent f668e29 commit bdc3827
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ class YourCustomLog extends TalkerLog {
}
final talker = Talker();
talker.logTyped(YourCustomLog('Something like your own service message'));
talker.logCustom(YourCustomLog('Something like your own service message'));
```

<p align="center"><a href="https://frezyx.github.io/talker" align="center"><img src="https://github.com/Frezyx/talker/blob/dev/docs/assets/logger/custom_log.png?raw=true"></a></p>
Expand Down
2 changes: 1 addition & 1 deletion packages/talker/example/talker_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Future<void> main() async {
}

/// Custom logs
talker.logTyped(YourCustomLog('Something like your own service message'));
talker.logCustom(YourCustomLog('Something like your own service message'));
}

class YourCustomLog extends TalkerLog {
Expand Down
2 changes: 1 addition & 1 deletion packages/talker/lib/src/talker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ class Talker {
///
/// //You can add here response model of your request
/// final httpLog = HttpTalkerLog('Http status: 200');
/// talker.logTyped(httpLog);
/// talker.logCustom(httpLog);
/// ```
/// {@endtemplate}
void logCustom(TalkerLog log) => _handleLogData(log);
Expand Down
2 changes: 1 addition & 1 deletion packages/talker/test/talker_settings_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void main() {
logger: TalkerLogger(),
);
final httpLog = HttpTalkerLog('Http good');
talker.logTyped(httpLog);
talker.logCustom(httpLog);

expect(
talker.history.whereType<HttpTalkerLog>().isNotEmpty,
Expand Down
10 changes: 5 additions & 5 deletions packages/talker_bloc_logger/lib/talker_bloc_logger_observer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class TalkerBlocObserver extends BlocObserver {
if (!accepted) {
return;
}
_talker.logTyped(
_talker.logCustom(
BlocEventLog(
bloc: bloc,
event: event,
Expand All @@ -50,7 +50,7 @@ class TalkerBlocObserver extends BlocObserver {
if (!accepted) {
return;
}
_talker.logTyped(BlocStateLog(
_talker.logCustom(BlocStateLog(
bloc: bloc,
transition: transition,
settings: settings,
Expand All @@ -63,7 +63,7 @@ class TalkerBlocObserver extends BlocObserver {
if (!settings.enabled || !settings.printChanges) {
return;
}
_talker.logTyped(
_talker.logCustom(
BlocChangeLog(
bloc: bloc,
change: change,
Expand All @@ -85,7 +85,7 @@ class TalkerBlocObserver extends BlocObserver {
if (!settings.enabled || !settings.printCreations) {
return;
}
_talker.logTyped(BlocCreateLog(bloc: bloc));
_talker.logCustom(BlocCreateLog(bloc: bloc));
}

@override
Expand All @@ -94,6 +94,6 @@ class TalkerBlocObserver extends BlocObserver {
if (!settings.enabled || !settings.printClosings) {
return;
}
_talker.logTyped(BlocCloseLog(bloc: bloc));
_talker.logCustom(BlocCloseLog(bloc: bloc));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class TalkerDioLogger extends Interceptor {
requestOptions: options,
settings: settings,
);
_talker.logTyped(httpLog);
_talker.logCustom(httpLog);
} catch (_) {
//pass
}
Expand All @@ -98,7 +98,7 @@ class TalkerDioLogger extends Interceptor {
settings: settings,
response: response,
);
_talker.logTyped(httpLog);
_talker.logCustom(httpLog);
} catch (_) {
//pass
}
Expand All @@ -121,7 +121,7 @@ class TalkerDioLogger extends Interceptor {
dioException: err,
settings: settings,
);
_talker.logTyped(httpErrorLog);
_talker.logCustom(httpErrorLog);
} catch (_) {
//pass
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class _ExtendedExampleState extends State<ExtendedExample> {
}

void _customLog() {
_talker.logTyped(CustomLog('Custom log message'));
_talker.logCustom(CustomLog('Custom log message'));
}

void _criticalLog() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class TalkerRouteObserver extends NavigatorObserver {
if (route.settings.name == null) {
return;
}
talker.logTyped(TalkerRouteLog(route: route));
talker.logCustom(TalkerRouteLog(route: route));
}

@override
Expand All @@ -23,7 +23,7 @@ class TalkerRouteObserver extends NavigatorObserver {
if (route.settings.name == null) {
return;
}
talker.logTyped(TalkerRouteLog(route: route, isPush: false));
talker.logCustom(TalkerRouteLog(route: route, isPush: false));
}
}

Expand Down
4 changes: 2 additions & 2 deletions packages/talker_http_logger/lib/talker_http_logger.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class TalkerHttpLogger extends InterceptorContract {
required BaseRequest request,
}) async {
final message = '${request.url}';
_talker.logTyped(HttpRequestLog(message, request: request));
_talker.logCustom(HttpRequestLog(message, request: request));
return request;
}

Expand All @@ -26,7 +26,7 @@ class TalkerHttpLogger extends InterceptorContract {
required BaseResponse response,
}) async {
final message = '${response.request?.url}';
_talker.logTyped(HttpResponseLog(message, response: response));
_talker.logCustom(HttpResponseLog(message, response: response));
return response;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class TalkerRiverpodObserver extends ProviderObserver {
if (!accepted) {
return;
}
_talker.logTyped(
_talker.logCustom(
RiverpodAddLog(
provider: provider,
value: value,
Expand All @@ -59,7 +59,7 @@ class TalkerRiverpodObserver extends ProviderObserver {
if (!accepted) {
return;
}
_talker.logTyped(
_talker.logCustom(
RiverpodUpdateLog(
provider: provider,
previousValue: previousValue,
Expand All @@ -83,7 +83,7 @@ class TalkerRiverpodObserver extends ProviderObserver {
if (!accepted) {
return;
}
_talker.logTyped(
_talker.logCustom(
RiverpodDisposeLog(
provider: provider,
settings: settings,
Expand All @@ -107,7 +107,7 @@ class TalkerRiverpodObserver extends ProviderObserver {
if (!accepted) {
return;
}
_talker.logTyped(
_talker.logCustom(
RiverpodFailLog(
provider: provider,
providerError: error,
Expand Down

0 comments on commit bdc3827

Please sign in to comment.