logPerformance method

  1. @override
void logPerformance(
  1. String operation,
  2. Duration duration, {
  3. Map<String, dynamic>? context,
})
override

Log performance metrics.

Implementation

@override
void logPerformance(
  String operation,
  Duration duration, {
  Map<String, dynamic>? context,
}) {
  if (options.logLevel == VanturaLogLevel.none ||
      VanturaLogLevel.info.index < options.logLevel.index)
    return;

  final redactedContext = _redact(context);
  final contextStr = (redactedContext != null && redactedContext.isNotEmpty)
      ? ' | Context: $redactedContext'
      : '';
  _print(
    '$_magenta[PERFORMANCE] $operation took ${duration.inMilliseconds}ms$contextStr$_reset',
  );
}