diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2017-12-14 08:42:41 +0300 |
---|---|---|
committer | Matthieu Aubry <mattab@users.noreply.github.com> | 2017-12-14 08:42:41 +0300 |
commit | c4a4444a56cffcaee9ec86435165c1bfb4f673f8 (patch) | |
tree | 8a2842218eb981a73637ca7887fc0cbb199919a1 /core/Plugin/Visualization.php | |
parent | 2f23f81ac6c345c489b8b7659c3c139097816659 (diff) |
Show trace in log message only if enabled. (#12357)
Diffstat (limited to 'core/Plugin/Visualization.php')
-rw-r--r-- | core/Plugin/Visualization.php | 7 |
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); } |