/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }