public function addHandler(Handler $handler, $getsPrevious = true, $prepend = false)
    {
        foreach ($this->handlers as $level => $handlers) {
            if ($handler->accepts($level)) {
                if ($prepend) {
                    array_unshift($this->handlers[$level], $handler);
                } else {
                    array_push($this->handlers[$level], $handler);
                }
            }
        }
        if ($getsPrevious) {
            $records = array();
            foreach ($this->log as $record) {
                if ($handler->accepts($record['level'])) {
                    $records[] = $record;
                }
            }
            if (count($records)) {
                $handler->handleBatch($records);
            }
        }
    }