Skip to content

Commit

Permalink
implement PSR-3 logging
Browse files Browse the repository at this point in the history
  • Loading branch information
estebangarcia committed Jun 1, 2021
1 parent dc8e6fd commit 8402338
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 76 deletions.
17 changes: 17 additions & 0 deletions EchoLogger.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php


namespace Binance;


use Psr\Log\AbstractLogger;

class EchoLogger extends AbstractLogger
{

public function log($level, $message, array $context = array())
{
$format = "[%s][%s] - %s";
echo sprintf($format, date("Y-m-d H:i:s"), $level, $message);
}
}
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"ext-curl": "*",
"ratchet/pawl": "^0.3.0",
"react/socket": "^1.0 || ^0.8 || ^0.7",
"ratchet/rfc6455": "^0.3"
"ratchet/rfc6455": "^0.3",
"psr/log": "^1.1"
},
"require-dev": {
"phpunit/phpunit": "~6",
Expand Down
Loading

0 comments on commit 8402338

Please sign in to comment.