Пример #1
0
 /**
  * Adds new logging channel to the registry
  *
  * @param  ehough_epilog_Logger      $logger    Instance of the logging channel
  * @param  string|null               $name      Name of the logging channel ($logger->getName() by default)
  * @param  boolean                   $overwrite Overwrite instance in the registry if the given name already exists?
  * @throws \InvalidArgumentException If $overwrite set to false and named Logger instance already exists
  */
 public static function addLogger(ehough_epilog_Logger $logger, $name = null, $overwrite = false)
 {
     $name = $name ? $name : $logger->getName();
     if (isset(self::$loggers[$name]) && !$overwrite) {
         throw new InvalidArgumentException('Logger with the given name already exists');
     }
     self::$loggers[$name] = $logger;
 }