Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/src/generators/logging/logger_class_content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ const String loggerClassPrefex = '''
/// Maybe this should be generated for the user as well?
///
/// import 'package:customer_app/services/stackdriver/stackdriver_service.dart';
library;

import 'package:flutter/foundation.dart';
import 'package:logger/logger.dart';
''';
Expand Down Expand Up @@ -73,7 +75,7 @@ class SimpleLogPrinter extends LogPrinter {
.last;
} else {
final realFirstLine = formattedStacktrace
?.firstWhere((line) => line.contains(className), orElse: () => "");
?.firstWhere((line) => line.contains(className), orElse: () => '');

final methodName = realFirstLine?.replaceAll('\$className.', '');
return methodName;
Expand Down Expand Up @@ -122,7 +124,7 @@ List<String>? _formatStackTrace(StackTrace stackTrace, int methodCount) {
if (match.group(2)!.startsWith('package:logger')) {
continue;
}
var newLine = ("\${match.group(1)}");
var newLine = ('\${match.group(1)}');
formatted.add(newLine.replaceAll('<anonymous closure>', '()'));
if (++count == methodCount) {
break;
Expand Down