Beispiel #1
0
 /**
  * Construct stream log handler.
  * @param resource $stream Stream t o log to.
  * @param string $level Minimum log level, see {@see \Psr\Log\LogLevel}.
  * @param bool $useLocking Whether to lock the file before appending to ensure
  * atomicity of each write.
  */
 public function __construct($stream, $level = LogLevel::DEBUG, $useLocking = false)
 {
     parent::__construct($level);
     $this->stream = $stream;
     $this->useLocking = $useLocking;
 }
Beispiel #2
0
 /**
  * Construct callback log handler.
  * @param callabke $callback Log hanlder function.
  * @param string $level Minimum log level, see {@see \Psr\Log\LogLevel}.
  */
 public function __construct($callback, $level = LogLevel::DEBUG)
 {
     parent::__construct($level);
     $this->callback = $callback;
 }
Beispiel #3
0
 /**
  * Construct CLI log handler.
  * @param Shell $shell Shell to log to.
  * @param string $level Minimum log level, see {@see \Psr\Log\LogLevel}.
  */
 public function __construct(Shell $shell, $level = LogLevel::INFO)
 {
     parent::__construct($level);
     $this->shell = $shell;
 }
Beispiel #4
0
 /**
  * Construct PSR-3 logger handler.
  * @param LoggerInterface $logger PSR-3 logger.
  * @param int $level Minimum log level, see {@see LogLevel}.
  */
 public function __construct(LoggerInterface $logger, $level = LogLevel::DEBUG)
 {
     parent::__construct($level);
     $this->logger = $logger;
 }