v method

  1. @override
void v(
  1. dynamic message, [
  2. dynamic error,
  3. StackTrace? stackTrace
])

Log a message at level Level.verbose.

Implementation

@override
void v(message, [error, StackTrace? stackTrace]) {
  if (level.index >= leisim.Level.verbose.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] : '';

    _printMultiLine('${black('[v]')} ${message.toString()}', suffix: ' ${black(' at: $stackTrace')}');
  }
}