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:
authorThomas Steur <tsteur@users.noreply.github.com>2017-12-14 08:42:41 +0300
committerMatthieu Aubry <mattab@users.noreply.github.com>2017-12-14 08:42:41 +0300
commitc4a4444a56cffcaee9ec86435165c1bfb4f673f8 (patch)
tree8a2842218eb981a73637ca7887fc0cbb199919a1
parent2f23f81ac6c345c489b8b7659c3c139097816659 (diff)
Show trace in log message only if enabled. (#12357)
-rw-r--r--core/Plugin/Visualization.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/Plugin/Visualization.php b/core/Plugin/Visualization.php
index bd46547e64..283a5a4087 100644
--- a/core/Plugin/Visualization.php
+++ b/core/Plugin/Visualization.php
@@ -194,13 +194,16 @@ class Visualization extends ViewDataTable
} catch (NoAccessException $e) {
throw $e;
} catch (\Exception $e) {
- Log::error("Failed to get data from API: " . $e->getMessage() . "\n" . $e->getTraceAsString());
-
+ $logMessage = "Failed to get data from API: " . $e->getMessage();
$message = $e->getMessage();
+
if (\Piwik_ShouldPrintBackTraceWithMessage()) {
+ $logMessage .= "\n" . $e->getTraceAsString();
$message .= "\n" . $e->getTraceAsString();
}
+ Log::error($logMessage);
+
$loadingError = array('message' => $message);
}