+ private function doLog() {
+ $logger = LoggerFactory::getInstance( 'HttpError' );
+ $content = $this->content;
+
+ if ( $content instanceof Message ) {
+ $content = $content->text();
+ }
+
+ $context = array(
+ 'file' => $this->getFile(),
+ 'line' => $this->getLine(),
+ 'http_code' => $this->httpCode,
+ );
+
+ $logMsg = "$content ({http_code}) from {file}:{line}";
+
+ if ( $this->getStatusCode() < 500 ) {
+ $logger->info( $logMsg, $context );
+ } else {
+ $logger->error( $logMsg, $context );
+ }
+ }
+