Skip to content

Commit 8ab7d76

Browse files
committed
Use Monolog instead of custom solution
Remove that ugly `openlog` & `syslog`
1 parent 149a333 commit 8ab7d76

File tree

4 files changed

+208
-181
lines changed

4 files changed

+208
-181
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,20 @@ if ($result) {
4545
echo 'Looks like we couldn\'t find the content. :(';
4646
}
4747
```
48+
49+
If you want to debug it, or check what's going on, you can inject a logger (which must follow `Psr\Log\LoggerInterface`, Monolog for example):
50+
51+
```php
52+
use Readability\Readability;
53+
use Monolog\Logger;
54+
use Monolog\Handler\StreamHandler;
55+
56+
$url = 'http://www.medialens.org/index.php/alerts/alert-archive/alerts-2013/729-thatcher.html';
57+
$html = file_get_contents($url);
58+
59+
$logger = new Logger('readability');
60+
$logger->pushHandler(new StreamHandler('path/to/your.log', Logger::DEBUG));
61+
62+
$readability = new Readability($html, $url);
63+
$readability->setLogger($logger);
64+
```

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
"role": "Developer (original JS version)"
2525
}],
2626
"require": {
27-
"php": ">=5.3.3"
27+
"php": ">=5.3.3",
28+
"monolog/monolog": "^1.13.1"
2829
},
2930
"require-dev": {
3031
"satooshi/php-coveralls": "~0.6"

0 commit comments

Comments
 (0)