d method
Log a message at level Level.debug
.
Implementation
@override
void d(message, [error, StackTrace? stackTrace]) {
if (level.index >= leisim.Level.debug.index && kDebugMode) {
List<String> stackTraceLine = '${StackTrace.current}'
.split('\n')
.where((line) => line.length > 2)
.map((line) => line.substring(1).replaceAll(RegExp(r'^([0-9])+'), '').trim())
.takeWhile((line) => !line.contains('package:flutter'))
.skip(1)
.toList();
String stackTrace = stackTraceLine.isNotEmpty ? stackTraceLine[0] : '';
// print('${green('๐งช')} ${message.toString()}'
// '\n'
// ' ${green('โโโโโ at: $stackTrace')}');
_printMultiLine('${green('[DEBUG]')} ${message.toString()}', suffix: ' ${green(' at: $stackTrace')}');
}
}