levelAsStatus method

  1. @protected
  2. @visibleForTesting
String levelAsStatus(
  1. Level level
)

Implementation

@protected
@visibleForTesting
String levelAsStatus(Level level) {
  // Capture 'fine' logs as well as `SHOUT` since SHOUT
  // is intended for debugging
  if (level.value <= 500 || level == Level.SHOUT) return 'debug';

  if (level == Level.INFO) return 'info';

  if (level == Level.CONFIG) return 'notice';

  if (level == Level.WARNING) return 'warn';

  if (level == Level.SEVERE) return 'error';

  return 'critical';
}