Description
It's tempting to write:
$this->log = Logger::getRootLogger();
$this->log->setLevel(LoggerLevel::WARN);
which at first succeedes but throws an exception when first using this Logger.
It would be more obvious to the user when he gets an immediate compiler error due to type hints.
— Logger.php.orig 2012-05-25 16:55:35.000000000 +0200
+++ Logger.php 2012-05-25 17:02:04.000000000 +0200
@@ -376,9 +376,11 @@
/**
- Set the Logger level.
*
+ * Use LoggerLevel::getLevelWarn() etc. to get a LoggerLevel object.
+ * - @param LoggerLevel $level the level to set
*/
- public function setLevel($level) {
+ public function setLevel(LoggerLevel $level) { $this->level = $level; }