Implementation of addHandler in Logger

@param mixed $destination Destination to which to send handler to
@param mixed $pattern     Regex pattern

@access public
@return void
779342
public function addHandler($destination, $pattern=Logger::ALL, $level='LOG_INFO', $type='file')
    {
        $this->_logPatterns[$pattern] = $this->buildHandler($destination, $level, $type);

    }
562306
public function post(string $pattern, callable $callback)
    {
        if ($this->requestMethod === "POST") {
            $this->mapRoute($pattern, $callback);
        }
    }
863723
public static function registerHandlers($logFile = 'error.log', $logDir = 'data/logs')
    {
        $logger = new self($logFile, $logDir);
        self::registerErrorHandler($logger, true);
        self::registerExceptionHandler($logger);
    }
176242
protected function prepareDestination(BaseClosure $destination)
    {
        return function ($passable) use ($destination) {
            try {
                return \call_user_func($destination, $passable);
            } catch (Exception $e) {
                return $this->handleException($passable, $e);
            } catch (Throwable $e) {
                return $this->handleException($passable, new FatalThrowableError($e));
            }
        };
    }
494184
function addPattern($pattern, $label = true) {
            $count = count($this->_patterns);
            $this->_patterns[$count] = $pattern;
            $this->_labels[$count] = $label;
            $this->_regex = null;
        }
1166719
public function put($pattern, $handler, array $requirements = [], array $defaults = [])
    {
        $this->addRoute('PUT', $pattern, $handler, $requirements, $defaults);
    }
280683
public function assertRegExp($pattern, $message = '')
    {
        Assert::assertRegExp($pattern, $this->getData(), $message);

        return $this;
    }
256594
private function addRoute($method, $pattern, $action)
    {

        if (is_array($method)) {
            foreach ($method as $verb) {
                $this->routes[$verb . $pattern] = ['method' => $verb, 'uri' => self::patternFactory($pattern), 'action' => $action];
            }
        } else {
            $this->routes[$method . $pattern] = ['method' => $method, 'uri' => self::patternFactory($pattern), 'action' => $action];
        }
    }
507687
protected function executeInTransaction(string $method) : void
    {
        try {
            $this->database->beginTransaction();

            $this->{$method}();

            $this->database->commit();
        } catch (Exception $exception) {
            $this->database->rollBack();

            $this->handleException($exception);
        }
    }
1284176
final public function preQuery($pattern, $data = null)
    {
        $this->preQueries[] = array($pattern, $data);
        if ($this->connected) {
            $this->execPre();
        }
    }
195279
public function connect(string $pattern, $stages): void
    {
        $pipeline = new HttpPipeline(RequestMethodInterface::METHOD_CONNECT, $this->prefix.$pattern, $this->routerStages);
        $pipeline->pipe($stages);
        $this->pipelineCollection->add($pipeline);
    }
489227
public function add($method, $pattern): RouteInterface
    {
        $route = new Route($this, $method);
        $route->setContainer($this->container);
        if (null !== $this->actionClass) {
            $route->setActionClass($this->actionClass);
        }
        if (null !== $this->requestClass) {
            $route->setRequestClass($this->requestClass);
        }
        $route->setPackage($this->getPackage());
        $prefixes = [$this->resourceName];
        if ($this->isSubResourceOfPackage()) {
            # Add package before resource
            array_unshift($prefixes, $this->packageName);
        }
        if ($this->routesPrefix) {
            # Add prefix before resource
            array_unshift($prefixes, $this->routesPrefix);
        }
        $pattern = $this->trailingSlash($pattern);
        $pattern = implode('/', $prefixes) . $pattern;
        $pattern = '/' . ltrim($pattern, '/');
        $route->setPattern($pattern);

        $this->data[] = $route;

        return $route;
    }
684421
public function afterMove($source, $destination)
    {
        $pathFilter = $this->pathFilter;
        if ($pathFilter && !$pathFilter($source)) {
            return;
        }
        // If the destination is filtered, afterUnbind will handle cleaning up
        // the properties.
        if ($pathFilter && !$pathFilter($destination)) {
            return;
        }

        $this->backend->move($source, $destination);
    }
704595
protected function messageLoggedHandler(MessageLogged $logEntry)
    {
        Integration::addBreadcrumb(new Breadcrumb(
            $logEntry->level,
            Breadcrumb::TYPE_USER,
            'log.' . $logEntry->level,
            $logEntry->message,
            empty($logEntry->context) ? [] : ['params' => $logEntry->context]
        ));
    }
566449
public function map($pattern, $handler = null, $methods = '*')
    {
        $this->routes[$pattern] = [
            'handler' => $handler,
            'methods' => $methods,
        ];
    }
384864
public function trace(string $pattern, $stages): void
    {
        $pipeline = new HttpPipeline(RequestMethodInterface::METHOD_TRACE, $this->prefix.$pattern, $this->routerStages);
        $pipeline->pipe($stages);
        $this->pipelineCollection->add($pipeline);
    }
4236
public function map(string $pattern, array $verbs, $stages): void
    {
        $pipeline = new HttpPipeline($verbs, $this->prefix.$pattern, $this->routerStages);
        $pipeline->pipe($stages);
        $this->pipelineCollection->add($pipeline);
    }