Skip to content
Open
Show file tree
Hide file tree
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
15 changes: 8 additions & 7 deletions lib/src/generators/logging/logger_class_content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ class SimpleLogPrinter extends LogPrinter {
final String className;
final bool printCallingFunctionName;
final bool printCallStack;
final List<String> exludeLogsFromClasses;
final List<String> excludeLogsFromClasses;
final String? showOnlyClass;

SimpleLogPrinter(
this.className, {
this.printCallingFunctionName = true,
this.printCallStack = false,
this.exludeLogsFromClasses = const [],
this.excludeLogsFromClasses = const [],
this.showOnlyClass,
});

Expand All @@ -46,7 +46,7 @@ class SimpleLogPrinter extends LogPrinter {
var output =
'\$emoji \$className\$methodNameSection - \${event.message}\${event.error != null ? '\\nERROR: \${event.error}\\n' : ''}\${printCallStack ? '\\nSTACKTRACE:\\n\$stackLog' : ''}';

if (exludeLogsFromClasses.any(
if (excludeLogsFromClasses.any(
(excludeClass) => className == excludeClass,
) ||
(showOnlyClass != null && className != showOnlyClass)) {
Expand Down Expand Up @@ -98,7 +98,7 @@ class SimpleLogPrinter extends LogPrinter {
.toList();
}

/// When the faulty word exists in the begging this method will not be very usefull
/// When the faulty word exists in the begging this method will not be very useful
String _findMostMatchedTrace(List<String> stackTraces, List<String> keyWords) {
String match = stackTraces.firstWhere(
(trace) => _doesTraceContainsAllKeywords(trace, keyWords),
Expand Down Expand Up @@ -148,12 +148,13 @@ List<String>? _formatStackTrace(StackTrace stackTrace, int methodCount) {

''';

const String loggerClassNameAndOutputs = '''
const String loggerClassNameAndOutputs =
'''
Logger $logHelperNameKey(
String className, {
bool printCallingFunctionName = true,
bool printCallstack = false,
List<String> exludeLogsFromClasses = const [],
List<String> excludeLogsFromClasses = const [],
String? showOnlyClass,
}) {
return Logger(
Expand All @@ -162,7 +163,7 @@ Logger $logHelperNameKey(
printCallingFunctionName: printCallingFunctionName,
printCallStack: printCallstack,
showOnlyClass: showOnlyClass,
exludeLogsFromClasses: exludeLogsFromClasses,
excludeLogsFromClasses: excludeLogsFromClasses,
),
output: MultiOutput([
$disableConsoleOutputInRelease
Expand Down
Loading