function $AdfServerLogWriter$$() {
  this.Init()
}
$goog$exportSymbol$$("AdfServerLogWriter", $AdfServerLogWriter$$);
$AdfObject$$.$createSubclass$($AdfServerLogWriter$$, $AdfLogWriter$$);
$AdfServerLogWriter$$.prototype.flush = function $$AdfServerLogWriter$$$$flush$() {
  this.$CheckIfClosed$();
  if(this.$_loggedMessages$.length) {
    if(window.JSON) {
      var $xmlHttp$$ = $AdfAgent$$.$AGENT$.$createXMLHttpRequest$();
      if($xmlHttp$$) {
        var $content$$inline_327_jsonMessages$$inline_326$$ = JSON.stringify(this.$_loggedMessages$), $content$$inline_327_jsonMessages$$inline_326$$ = "logRecords\x3d" + encodeURIComponent($content$$inline_327_jsonMessages$$inline_326$$).replace(/\'/g, "%27").replace(/%20/g, "+"), $endPointUrl$$inline_5017$$ = $JSCompiler_alias_NULL$$, $form$$inline_5018$$ = document.forms[0];
        $form$$inline_5018$$ && ($endPointUrl$$inline_5017$$ = $form$$inline_5018$$.action);
        $endPointUrl$$inline_5017$$ || ($endPointUrl$$inline_5017$$ = document.location.href);
        $xmlHttp$$.open("POST", $endPointUrl$$inline_5017$$, $JSCompiler_alias_TRUE$$);
        $xmlHttp$$.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        $xmlHttp$$.setRequestHeader("Adf-Rich-Log", "true");
        $xmlHttp$$.send($content$$inline_327_jsonMessages$$inline_326$$)
      }
    }
    this.$_loggedMessages$ = []
  }
};
$AdfObject$$.$exportPrototypeSymbol$("AdfServerLogWriter.prototype.flush", {flush:$AdfServerLogWriter$$.prototype.flush});
$AdfServerLogWriter$$.$_JSONStringifyRecord$ = function $$AdfServerLogWriter$$$$_JSONStringifyRecord$$($logRecord$$8$$) {
  try {
    return JSON.stringify($logRecord$$8$$)
  }catch($stringifyError$$) {
    return $JSCompiler_alias_NULL$$
  }
};
$AdfServerLogWriter$$.$_RECORD_PROPERTIES$ = ["level", "message", "error", "when", "responseId"];
$AdfServerLogWriter$$.$_jsonProperty$ = function $$AdfServerLogWriter$$$$_jsonProperty$$($key$$29$$, $value$$83$$) {
  if($value$$83$$ === $JSCompiler_alias_VOID$$) {
    return $JSCompiler_alias_NULL$$
  }
  var $stringValue$$1$$;
  switch(typeof $value$$83$$) {
    case "boolean":
    ;
    case "number":
      $stringValue$$1$$ = "" + $value$$83$$;
      break;
    default:
      $stringValue$$1$$ = '"' + $value$$83$$ + '"'
  }
  return'"' + $key$$29$$ + '":' + $stringValue$$1$$
};
$AdfServerLogWriter$$.$_shallowStringifyRecord$ = function $$AdfServerLogWriter$$$$_shallowStringifyRecord$$($logRecord$$9$$) {
  try {
    for(var $recordProperties$$ = $AdfServerLogWriter$$.$_RECORD_PROPERTIES$, $propertyCount$$1$$ = $recordProperties$$.length, $properties$$27$$ = Array($propertyCount$$1$$), $i$$53$$ = 0;$i$$53$$ < $propertyCount$$1$$;$i$$53$$++) {
      var $propertyName$$29$$ = $recordProperties$$[$i$$53$$], $jsonProperty$$ = $AdfServerLogWriter$$.$_jsonProperty$($propertyName$$29$$, $logRecord$$9$$[$propertyName$$29$$]);
      $jsonProperty$$ && $properties$$27$$.push($jsonProperty$$)
    }
    return"{" + $properties$$27$$.join(",") + "}"
  }catch($stringifyError$$1$$) {
    return $JSCompiler_alias_NULL$$
  }
};
$AdfServerLogWriter$$.prototype.Init = function $$AdfServerLogWriter$$$$Init$() {
  $AdfServerLogWriter$$.$superclass$.Init.call(this);
  this.$_loggedMessages$ = []
};
$AdfObject$$.$exportPrototypeSymbol$("AdfServerLogWriter.prototype.Init", {Init:$AdfServerLogWriter$$.prototype.Init});
$AdfServerLogWriter$$.prototype.$PublishImpl$ = function $$AdfServerLogWriter$$$$$PublishImpl$$($logRecord$$11$$) {
  this.$CheckIfClosed$();
  $AdfAssert$$.assert($logRecord$$11$$, "null logRecord");
  this.$_loggedMessages$.push($logRecord$$11$$)
};
$AdfObject$$.$exportPrototypeSymbol$("AdfServerLogWriter.prototype.PublishImpl", {$PublishImpl$:$AdfServerLogWriter$$.prototype.$PublishImpl$});
