isLogActive function

bool isLogActive(
  1. Logger logger
)

Returns true if the given logger is currently logging, or false otherwise.

Generally, developers should call loggers, regardless of whether a given logger is active. However, sometimes you may want to log information that's costly to compute. In such a case, you can choose to compute the expensive information only if the given logger will actually log the information.

Implementation

bool isLogActive(logging.Logger logger) {
  return _activeLoggers.contains(logger);
}