public function getLevelCode(string $level): int
    {
        if ($this->levelIsValid($level) === false) {
            throw new \InvalidArgumentException('Invalid log-level provided.');
        }
        return array_search($level, $this->levels);
    }