extractStack method
Extracts the stack trace from a LogRecord.
Returns an empty list if the stack trace is null.
Implementation
List<String> extractStack(StackTrace? stackTrace, List<String> excludePaths) {
if (stackTrace == null) return [];
final formatted = StackTraceParser.formatStackTrace(
stackTrace,
3, // Take first 3 lines
excludePaths: excludePaths,
);
return formatted?.split('\n') ?? [];
}