private function convertLevel($level)
    {
        # If this is one of the defined string log levels then return it's numeric value
        if (!array_key_exists($level, $this->levels)) {
            throw new InvalidArgumentException("Unknown log level: {$level}");
        }

        return $this->levels[$level];
    }