protected function addRecord($level, $message, array $context = array())
    {
        $message = $this->interpolate($message, $context);
        $record = array(
            'message' => (string) $message,
            'context' => $context,
            'level' => self::getLevelCode($level),
            'level_name' => strtoupper($level),
            'datetime' => new \DateTime(),
            'ip' => self::getUserIp(),
            'pid' => @getmypid(),
            'extra' => array(),
        );
        return self::write(self::getLogRecord($record)."\n", $level);
    }