-
Notifications
You must be signed in to change notification settings - Fork 974
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #950 from ezimuel/add-port-in-logger
Added the HTTP port in the log messages
- Loading branch information
Showing
4 changed files
with
118 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
declare(strict_types = 1); | ||
|
||
namespace Elasticsearch\Tests\ClientBuilder; | ||
|
||
use Psr\Log\LoggerInterface; | ||
use Psr\Log\LogLevel; | ||
|
||
class ArrayLogger implements LoggerInterface | ||
{ | ||
public $output = []; | ||
|
||
public function emergency($message, array $context = array()) | ||
{ | ||
$this->log(LogLevel::EMERGENCY, $message, $context); | ||
} | ||
|
||
public function alert($message, array $context = array()) | ||
{ | ||
$this->log(LogLevel::ALERT, $message, $context); | ||
} | ||
|
||
public function critical($message, array $context = array()) | ||
{ | ||
$this->log(LogLevel::CRITICAL, $message, $context); | ||
} | ||
|
||
public function error($message, array $context = array()) | ||
{ | ||
$this->log(LogLevel::ERROR, $message, $context); | ||
} | ||
|
||
public function warning($message, array $context = array()) | ||
{ | ||
$this->log(LogLevel::WARNING, $message, $context); | ||
} | ||
|
||
public function notice($message, array $context = array()) | ||
{ | ||
$this->log(LogLevel::NOTICE, $message, $context); | ||
} | ||
|
||
public function info($message, array $context = array()) | ||
{ | ||
$this->log(LogLevel::INFO, $message, $context); | ||
} | ||
|
||
public function debug($message, array $context = array()) | ||
{ | ||
$this->log(LogLevel::DEBUG, $message, $context); | ||
} | ||
|
||
public function log($level, $message, array $context = array()) | ||
{ | ||
$this->output[] = sprintf("%s: %s %s", $level, $message, json_encode($context)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,5 @@ | |
|
||
class DummyLogger | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters