-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
lashnev
committed
Sep 19, 2018
1 parent
c90b2d9
commit eafbc15
Showing
3 changed files
with
70 additions
and
6 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
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,59 @@ | ||
<?php | ||
|
||
namespace Platron\Starrys\tests\integration; | ||
|
||
use Psr\Log\LoggerInterface; | ||
|
||
class TestLogger implements LoggerInterface | ||
{ | ||
public function emergency($message, array $context = array()) | ||
{ | ||
$this->logToFile($message); | ||
} | ||
|
||
public function alert($message, array $context = array()) | ||
{ | ||
$this->logToFile($message); | ||
} | ||
|
||
public function critical($message, array $context = array()) | ||
{ | ||
$this->logToFile($message); | ||
} | ||
|
||
public function error($message, array $context = array()) | ||
{ | ||
$this->logToFile($message); | ||
} | ||
|
||
public function warning($message, array $context = array()) | ||
{ | ||
$this->logToFile($message); | ||
} | ||
|
||
public function notice($message, array $context = array()) | ||
{ | ||
$this->logToFile($message); | ||
} | ||
|
||
public function info($message, array $context = array()) | ||
{ | ||
$this->logToFile($message); | ||
} | ||
|
||
public function debug($message, array $context = array()) | ||
{ | ||
$this->logToFile($message); | ||
} | ||
|
||
public function log($level, $message, array $context = array()) | ||
{ | ||
$this->logToFile($message); | ||
} | ||
|
||
private function logToFile($message) | ||
{ | ||
$preparedString = date('Y-m-d H:i:s') . '; ' . $message . PHP_EOL; | ||
file_put_contents(__DIR__ . '/logs/' . date('Y-m-d') . '.log', $preparedString, FILE_APPEND); | ||
} | ||
} |