public function setLevel($logLevel)
{
if (is_int($logLevel)) {
$this->level = $logLevel;
} else {
$const = 'static::LEVEL_' . strtoupper($logLevel);
if (!defined($const)) {
throw new \InvalidArgumentException(sprintf("Unknown log level: %s", strip_tags($logLevel)));
}
$this->level = constant($const);
}
return $this;
}