Skip to content

Commit

Permalink
remove monolog, add piwk loggerinterface
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkeschiren committed Mar 10, 2024
1 parent 99c0d5f commit 9129f14
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 91 deletions.
10 changes: 9 additions & 1 deletion Sentry.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,16 @@
use Sentry\Severity;
use Piwik\Url;
use Piwik\Common;
use Piwik\Container\StaticContainer;
use Piwik\Log\LoggerInterface;

class Sentry extends \Piwik\Plugin
{
/**
* @var LoggerInterface
*/
private $logger;

/**
* @var string Config
*/
Expand All @@ -27,8 +34,9 @@ class Sentry extends \Piwik\Plugin
/**
* @param bool|string $pluginName
*/
public function __construct($pluginName = false)
public function __construct($pluginName = false, LoggerInterface $logger = null)
{
$this->logger = $logger ?: StaticContainer::get(LoggerInterface::class);
$matomoHost = Config::getHostname();
if (strlen($matomoHost) == 0) {
$host = Url::getHost($checkIfTrusted = false);
Expand Down
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"require": {
"sentry/sentry": "^4.5",
"symfony/http-client": "^6.4",
"http-interop/http-factory-guzzle": "^1.2",
"monolog/monolog": "~1.11"
"http-interop/http-factory-guzzle": "^1.2"
},
"require-dev": {
"phpunit/phpunit": "9.6.4",
Expand Down
88 changes: 1 addition & 87 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Sentry",
"description": "Log Matomo errors to Sentry",
"version": "5.0.12",
"version": "5.0.13",
"theme": false,
"require": {
"matomo": ">=5.0.0-stable,<6.0.0-b1",
Expand Down

0 comments on commit 9129f14

Please sign in to comment.