logSensitiveData property

bool get logSensitiveData

Implementation

bool get logSensitiveData {
  bool lsd = false;

  if (parent == null) {
    // We're either the root logger or a detached logger.  Return our own
    // level.
    lsd =  _sdl[this] ?? false;
  } else if (!hierarchicalLoggingEnabled) {
    lsd = _sdl[Logger.root] ?? false;
  } else {
    lsd = _sdl[this] ?? parent!.logSensitiveData;
  }

  return lsd;
}
set logSensitiveData (bool? enable)

Override the logging of sensitive data for this particular Logger and its children.

Setting this to null makes it inherit the parents setting.

Implementation

set logSensitiveData(bool? enable) {
  if (!hierarchicalLoggingEnabled && parent != null) {
    throw UnsupportedError(
        'Please set "hierarchicalLoggingEnabled" to true if you want to '
        'change the sensitive data logging on a non-root logger.');
  }
  if (parent == null && enable == null) {
    throw UnsupportedError(
        'Cannot set the sensitive logging to `null` on a logger with no parent.');
  }
  _sdl[this] = enable;
}