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 04:15:21 +0300
committerMatthieu Napoli <matthieu@mnapoli.fr>2014-12-01 04:15:21 +0300
commita726a1f907bd60945934cbf68f031c8507a3bf95 (patch)
treec783e86a71eac40fd4bb2b811feaa46bc5e0779a /core/Log.php
parente9a73aa910650f518cb8b8229995578df5063d53 (diff)
#6622 Logger refactoring: simplified log formatters
Diffstat (limited to 'core/Log.php')
-rw-r--r--core/Log.php50
1 files changed, 1 insertions, 49 deletions
diff --git a/core/Log.php b/core/Log.php
index 2892c4406d..904cdb0f83 100644
--- a/core/Log.php
+++ b/core/Log.php
@@ -10,8 +10,6 @@ namespace Piwik;
use Piwik\Container\StaticContainer;
use Piwik\Db;
-use Piwik\Log\Backend\StdOutBackend;
-use Piwik\Log\LoggerFactory;
/**
* Logging utility class.
@@ -155,14 +153,6 @@ class Log extends Singleton
*/
private $writers = array();
- /**
- * The log message format string that turns a tag name, date-time and message into
- * one string to log.
- *
- * @var string
- */
- private $logMessageFormat;
-
public static function getInstance()
{
if (self::$instance === null) {
@@ -181,14 +171,12 @@ class Log extends Singleton
/**
* @param callable[] $writers
- * @param string $logMessageFormat
* @param int $logLevel
* @param callable[] $processors
*/
- public function __construct(array $writers, $logMessageFormat, $logLevel, array $processors)
+ public function __construct(array $writers, $logLevel, array $processors)
{
$this->writers = $writers;
- $this->logMessageFormat = $logMessageFormat;
$this->currentLogLevel = $logLevel;
$this->processors = $processors;
}
@@ -256,29 +244,6 @@ class Log extends Singleton
self::logMessage(self::VERBOSE, $message, array_slice(func_get_args(), 1));
}
- /**
- * Creates log message combining logging info including a log level, tag name,
- * date time, and caller-provided log message. The log message can be set through
- * the `[log] string_message_format` INI config option. By default it will
- * create log messages like:
- *
- * **LEVEL [tag:datetime] log message**
- *
- * @param int $level
- * @param string $tag
- * @param string $datetime
- * @param string $message
- * @return string
- */
- public function formatMessage($level, $tag, $datetime, $message)
- {
- return str_replace(
- array("%tag%", "%message%", "%datetime%", "%level%"),
- array($tag, trim($message), $datetime, $this->getStringLevel($level)),
- $this->logMessageFormat
- );
- }
-
public function setLogLevel($logLevel)
{
$this->currentLogLevel = $logLevel;
@@ -321,19 +286,6 @@ class Log extends Singleton
return $level <= $this->currentLogLevel;
}
- private function getStringLevel($level)
- {
- static $levelToName = array(
- self::NONE => 'NONE',
- self::ERROR => 'ERROR',
- self::WARN => 'WARN',
- self::INFO => 'INFO',
- self::DEBUG => 'DEBUG',
- self::VERBOSE => 'VERBOSE'
- );
- return $levelToName[$level];
- }
-
private function getClassNameThatIsLogging($backtrace)
{
foreach ($backtrace as $tracepoint) {