You are here

protected function LoggerChannel::sortLoggers in Service Container 7.2

Same name and namespace in other branches
  1. 7 src/Logger/LoggerChannel.php \Drupal\service_container\Logger\LoggerChannel::sortLoggers()

Sorts loggers according to priority.

Return value

array An array of sorted loggers by priority.

1 call to LoggerChannel::sortLoggers()
LoggerChannel::log in src/Logger/LoggerChannel.php
Logs with an arbitrary level.

File

src/Logger/LoggerChannel.php, line 90
Contains \Drupal\service_container\Logger\LoggerChannel.

Class

LoggerChannel
Defines a logger channel that most implementations will use.

Namespace

Drupal\service_container\Logger

Code

protected function sortLoggers() {
  $sorted = array();
  krsort($this->loggers);
  foreach ($this->loggers as $loggers) {
    $sorted = array_merge($sorted, $loggers);
  }
  return $sorted;
}