0

Most standard Monolog (https://github.com/Seldaek/monolog/tree/master/src/Monolog) handlers handle their triggering internally, for example:

// https://github.com/Seldaek/monolog/blob/master/src/Monolog/Handler/PHPConsoleHandler.php#L76
public function __construct(array $options = [], Connector $connector = null, $level = Logger::DEBUG, $bubble = true)

Handler is registered like

$logger->pushHandler(new PHPConsoleHandler(/* ... arguments */));

Why not declare trigger level when registering the handler, like

$logger->pushHandler(new PHPConsoleHandler(), [Logger::DEBUG]);
nehalist
  • 1,434
  • 18
  • 45

1 Answers1

0

NOTE: Since I am not a developer of Monolog, this is just a guess.

What you have there is a command, that translates as "add item X to the handler array". When you look up different variation in numerous programming languages, you will see that, when push() function/method has multiple elements, they are all are thing that are added to the given array. See for example definitions in php and javascript. It is a convention.

tereško
  • 58,060
  • 25
  • 98
  • 150