Exemplo n.º 1
0
 /**
  * Construct callback log handler.
  *
  * @param callable $callback
  *            Log hanlder function.
  * @param string $level
  *            Minimum log level, see {@see \Psr\Log\LogLevel}.
  */
 public function __construct(callable $callback, $level = LogLevel::DEBUG)
 {
     parent::__construct($level);
     $this->callback = $callback;
 }
Exemplo n.º 2
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;
 }
Exemplo n.º 3
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;
 }
Exemplo n.º 4
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;
 }