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 <thomas.steur@googlemail.com>2014-03-31 06:30:47 +0400
committerThomas Steur <thomas.steur@googlemail.com>2014-03-31 06:30:47 +0400
commit3be7243ea4709e2f6ad50473d22364196b633f0a (patch)
tree27f9a1a98da04b40aeb08f5220ab7df147131a39 /core/Log.php
parent4fe44f28549d03bc7060a6b14f9fc35263e76b43 (diff)
wondering if this fixes the build? might look for a better solution afterwards
Diffstat (limited to 'core/Log.php')
-rw-r--r--core/Log.php27
1 files changed, 18 insertions, 9 deletions
diff --git a/core/Log.php b/core/Log.php
index 76e59709df..93b56e14e3 100644
--- a/core/Log.php
+++ b/core/Log.php
@@ -263,22 +263,31 @@ class Log extends Singleton
private function setLogWritersFromConfig($logConfig)
{
- $availableWritersByName = $this->getAvailableWriters();
-
// set the log writers
$logWriters = $logConfig[self::LOG_WRITERS_CONFIG_OPTION];
$logWriters = array_map('trim', $logWriters);
foreach ($logWriters as $writerName) {
- if (empty($availableWritersByName[$writerName])) {
- continue;
- }
+ $this->addLogWriter($writerName);
+ }
+ }
- $this->writers[] = $availableWritersByName[$writerName];
+ public function addLogWriter($writerName)
+ {
+ if (array_key_exists($writerName, $this->writers)) {
+ return;
+ }
- if ($writerName == 'screen') {
- $this->loggingToScreen = true;
- }
+ $availableWritersByName = $this->getAvailableWriters();
+
+ if (empty($availableWritersByName[$writerName])) {
+ return;
+ }
+
+ $this->writers[$writerName] = $availableWritersByName[$writerName];
+
+ if ($writerName == 'screen') {
+ $this->loggingToScreen = true;
}
}