shouldLog static method

bool shouldLog(
  1. String level,
  2. String minLevel
)

true when a line of level passes the minLevel setting. an unknown minLevel prints every line, so no log is lost.

Implementation

static bool shouldLog(String level, String minLevel) {
  int min = _ranks[minLevel.toLowerCase()] ?? 0;
  return (_ranks[level] ?? 3) >= min;
}