discontinuedPackage fluttersdk_telescope has been discontinued and replaced by crumbs.

redactLogRecord static method

LogRecordEntry? redactLogRecord(
  1. LogRecordEntry record
)

Return record with every text field run through the redactor and redacted set, or record itself when none is registered. Returns null, the record dropped, when the redactor throws.

Implementation

static LogRecordEntry? redactLogRecord(LogRecordEntry record) {
  final String Function(String)? redact = _guardedRedactor();
  if (redact == null) return record;

  return _dropOnRedactorFailure(
    () => _markRedacted(
      LogRecordEntry(
        level: redact(record.level),
        levelValue: record.levelValue,
        message: redact(record.message),
        loggerName: redact(record.loggerName),
        time: record.time,
        error: _text(record.error, redact),
        stackTrace: _text(record.stackTrace, redact),
        atUs: record.atUs,
      ),
    ),
  );
}