Skip to content

Commit dd0a746

Browse files
committed
implement PSR-3 logging
1 parent dc8e6fd commit dd0a746

File tree

3 files changed

+112
-76
lines changed

3 files changed

+112
-76
lines changed

EchoLogger.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
4+
namespace Binance;
5+
6+
7+
use Psr\Log\AbstractLogger;
8+
9+
class EchoLogger extends AbstractLogger
10+
{
11+
12+
public function log($level, $message, array $context = array())
13+
{
14+
$format = "[%s][%s] - %s";
15+
echo sprintf($format, date("Y-m-d H:i:s"), $level, $message);
16+
}
17+
}

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"ext-curl": "*",
1313
"ratchet/pawl": "^0.3.0",
1414
"react/socket": "^1.0 || ^0.8 || ^0.7",
15-
"ratchet/rfc6455": "^0.3"
15+
"ratchet/rfc6455": "^0.3",
16+
"psr/log": "^1.1"
1617
},
1718
"require-dev": {
1819
"phpunit/phpunit": "~6",

0 commit comments

Comments
 (0)