Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiosmosis <diosmosis@users.noreply.github.com>2019-12-16 02:58:31 +0300
committerThomas Steur <tsteur@users.noreply.github.com>2019-12-16 02:58:31 +0300
commit4b77587cb16e9144ba3718b6d1d6a66a690bfaf4 (patch)
tree5605d80d7da7d7a41a4ee70df60ddbe341f3f4e4
parent0e7267b955090a082d6d4473bc4991613f361d80 (diff)
If fingers crossed handler is used make sure to print out exceptions with the whole trace in console commands. (#15268)
-rw-r--r--core/Console.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/core/Console.php b/core/Console.php
index 9a2c45d6ac..945889bfed 100644
--- a/core/Console.php
+++ b/core/Console.php
@@ -9,6 +9,7 @@
namespace Piwik;
use Exception;
+use Monolog\Handler\FingersCrossedHandler;
use Piwik\Application\Environment;
use Piwik\Config\ConfigNotFoundException;
use Piwik\Container\StaticContainer;
@@ -65,6 +66,27 @@ class Console extends Application
$this->getDefinition()->addOption($option);
}
+ public function renderException($e, $output)
+ {
+ $logHandlers = StaticContainer::get('log.handlers');
+
+ $hasFingersCrossed = false;
+ foreach ($logHandlers as $handler) {
+ if ($handler instanceof FingersCrossedHandler) {
+ $hasFingersCrossed = true;
+ continue;
+ }
+ }
+
+ if ($hasFingersCrossed
+ && $output->getVerbosity() < OutputInterface::VERBOSITY_VERBOSE
+ ) {
+ $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE);
+ }
+
+ parent::renderException($e, $output);
+ }
+
public function doRun(InputInterface $input, OutputInterface $output)
{
if ($input->hasParameterOption('--xhprof')) {