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:
authorMatthieu Napoli <matthieu@mnapoli.fr>2014-12-01 06:24:29 +0300
committerMatthieu Napoli <matthieu@mnapoli.fr>2014-12-01 06:24:29 +0300
commitd263af9fc3aa7982f990dc48141dae4887139c0e (patch)
treed48463072a845e10b3df0667a037f15174cfa2c8 /core/Log.php
parent8f8275426fb62c61627b6e77ab0a377eb4864b71 (diff)
#6622 Logger refactoring: added Log\Processor\ClassNameProcessor
Diffstat (limited to 'core/Log.php')
-rw-r--r--core/Log.php48
1 files changed, 2 insertions, 46 deletions
diff --git a/core/Log.php b/core/Log.php
index 7ca7721f5e..44e64278fb 100644
--- a/core/Log.php
+++ b/core/Log.php
@@ -266,21 +266,14 @@ class Log extends Singleton
$record = $processor($record);
}
- $record['extra']['class'] = $this->getLoggingClassName();
-
- $this->writeMessage($record, date("Y-m-d H:i:s"));
- }
-
- private function writeMessage(array $record)
- {
foreach ($this->writers as $writer) {
call_user_func($writer, $record, $this);
}
}
- private static function logMessage($level, $message, $sprintfParams)
+ private static function logMessage($level, $message, $parameters)
{
- self::getInstance()->doLog($level, $message, $sprintfParams);
+ self::getInstance()->doLog($level, $message, $parameters);
}
private function shouldLoggerLog($level)
@@ -288,43 +281,6 @@ class Log extends Singleton
return $level <= $this->currentLogLevel;
}
- private function getClassNameThatIsLogging($backtrace)
- {
- foreach ($backtrace as $tracepoint) {
- if (isset($tracepoint['class'])
- && $tracepoint['class'] != 'Piwik\Log'
- && $tracepoint['class'] != 'Piwik\Piwik'
- && $tracepoint['class'] != 'Piwik\CronArchive'
- ) {
- return $tracepoint['class'];
- }
- }
- return false;
- }
-
- /**
- * Returns the name of the plugin/class that triggered the log.
- *
- * @return string
- */
- private function getLoggingClassName()
- {
- if (version_compare(phpversion(), '5.3.6', '>=')) {
- $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS | DEBUG_BACKTRACE_PROVIDE_OBJECT);
- } else {
- $backtrace = debug_backtrace();
- }
-
- $tag = Plugin::getPluginNameFromBacktrace($backtrace);
-
- // if we can't determine the plugin, use the name of the calling class
- if ($tag == false) {
- $tag = $this->getClassNameThatIsLogging($backtrace);
- return $tag;
- }
- return $tag;
- }
-
private function getStringLevel($level)
{
static $levelToName = array(