Skip to content

Commit

Permalink
. R code formatted
Browse files Browse the repository at this point in the history
  • Loading branch information
yelmuratoff committed Jun 27, 2024
1 parent 0787d3b commit 244b43a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
6 changes: 4 additions & 2 deletions packages/talker/lib/src/models/talker_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ class TalkerData {
/// [TalkerError] -> [TalkerError.generateTextMessage]
///
/// {@endtemplate}
String generateTextMessage({TimeFormat timeFormat = TimeFormat.timeAndSeconds}) {
String generateTextMessage(
{TimeFormat timeFormat = TimeFormat.timeAndSeconds}) {
return '${displayTitleWithTime(timeFormat: timeFormat)}$message$displayStackTrace';
}
}
Expand All @@ -80,7 +81,8 @@ class TalkerData {
extension FieldsToDisplay on TalkerData {
/// Displayed title of [TalkerData]
String displayTitleWithTime({TimeFormat timeFormat = TimeFormat.timeAndSeconds}) {
String displayTitleWithTime(
{TimeFormat timeFormat = TimeFormat.timeAndSeconds}) {
return '[$title] | ${displayTime(timeFormat: timeFormat)} | ';
}

Expand Down
20 changes: 14 additions & 6 deletions packages/talker_riverpod_logger/lib/riverpod_logs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,17 @@ class RiverpodAddLog extends TalkerLog {
String get key => TalkerLogType.riverpodAdd.key;

@override
String generateTextMessage({TimeFormat timeFormat = TimeFormat.timeAndSeconds}) {
String generateTextMessage(
{TimeFormat timeFormat = TimeFormat.timeAndSeconds}) {
return _createMessage(timeFormat: timeFormat);
}

String _createMessage({required TimeFormat timeFormat}) {
final sb = StringBuffer();
sb.write(displayTitleWithTime(timeFormat: timeFormat));
sb.write('\n$message');
sb.write('\n${'INITIAL state: ${settings.printStateFullData ? '\n$value' : value.runtimeType}'}');
sb.write(
'\n${'INITIAL state: ${settings.printStateFullData ? '\n$value' : value.runtimeType}'}');
return sb.toString();
}
}
Expand All @@ -60,7 +62,9 @@ class RiverpodUpdateLog extends TalkerLog {
provider: provider,
suffix: 'updated',
) +
(settings.printStateFullData ? '\nPREVIOUS state:\n$previousValue\nNEW state:\n$newValue' : ''),
(settings.printStateFullData
? '\nPREVIOUS state:\n$previousValue\nNEW state:\n$newValue'
: ''),
);

final ProviderBase<Object?> provider;
Expand All @@ -82,8 +86,10 @@ class RiverpodUpdateLog extends TalkerLog {
final sb = StringBuffer();
sb.write(displayTitleWithTime(timeFormat: timeFormat));
sb.write('\n$message');
sb.write('\n${'PREVIOUS state: ${settings.printStateFullData ? '\n$previousValue' : previousValue.runtimeType}'}');
sb.write('\n${'NEW state: ${settings.printStateFullData ? '\n$newValue' : newValue.runtimeType}'}');
sb.write(
'\n${'PREVIOUS state: ${settings.printStateFullData ? '\n$previousValue' : previousValue.runtimeType}'}');
sb.write(
'\n${'NEW state: ${settings.printStateFullData ? '\n$newValue' : newValue.runtimeType}'}');
return sb.toString();
}
}
Expand Down Expand Up @@ -133,7 +139,9 @@ class RiverpodFailLog extends TalkerLog {
provider: provider,
suffix: 'failed',
) +
(settings.printFailFullData ? '\nERROR:\n$providerError\nSTACK TRACE:\n$providerStackTrace' : ''),
(settings.printFailFullData
? '\nERROR:\n$providerError\nSTACK TRACE:\n$providerStackTrace'
: ''),
);

final ProviderBase<Object?> provider;
Expand Down

0 comments on commit 244b43a

Please sign in to comment.