public function registerError($level, callable $callback)
    {
        $reflection = new \ReflectionFunction($callback);
        $parameters = $reflection->getParameters();
        if (count($parameters) > 4) {
            throw new \Exception("Specified callback cannot have more than 4 arguments (message, file, line, context)");
        }
        $this->registeredErrorCallbacks[$level] = $callback;
    }