Created
October 8, 2013 13:42
-
-
Save jraddaoui/6884859 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
radawi@ubuntu:~/www/atom$ git diff | |
diff --git a/plugins/sfSearchPlugin/lib/log/xfLoggerTask.class.php b/plugins/sfSearchPlugin/lib/log/xfLoggerTask.class.php | |
index 6b65897..11740c5 100644 | |
--- a/plugins/sfSearchPlugin/lib/log/xfLoggerTask.class.php | |
+++ b/plugins/sfSearchPlugin/lib/log/xfLoggerTask.class.php | |
@@ -47,21 +47,27 @@ final class xfLoggerTask implements xfLogger | |
*/ | |
public function log($message, $section = 'sfSearch') | |
{ | |
- $message = preg_replace_callback('/"(.+?)"/', function($matches) | |
- { | |
- return $this->formatter->format($matches[1], array("fg" => "blue", "bold" => true)); | |
- }, $message); | |
+ $message = preg_replace_callback('/"(.+?)"/', array($this, 'formatBlue'), $message); | |
- $message = preg_replace_callback('/\.{3}$/', function($matches) | |
- { | |
- return $this->formatter->format("...", array("fg" => "red", "bold" => true)); | |
- }, $message); | |
+ $message = preg_replace_callback('/\.{3}$/', array($this, 'formatDots'), $message); | |
- $message = preg_replace_callback('/(Warning|Error)!/', function($matches) | |
- { | |
- return $this->formatter->format($matches[1].'!', array("fg" => "red", "bold" => true)); | |
- }, $message); | |
+ $message = preg_replace_callback('/(Warning|Error)!/', array($this, 'formatRed'), $message); | |
$this->dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->format($section, array('fg' => 'green', 'bold' => true)) . ' >> ' . $message))); | |
} | |
+ | |
+ private function formatBlue($matches) | |
+ { | |
+ return $this->formatter->format($matches[1], array("fg" => "blue", "bold" => true)); | |
+ } | |
+ | |
+ private function formatDots($matches) | |
+ { | |
+ return $this->formatter->format("...", array("fg" => "red", "bold" => true)); | |
+ } | |
+ | |
+ private function formatRed($matches) | |
+ { | |
+ return $this->formatter->format($matches[1].'!', array("fg" => "red", "bold" => true)); | |
+ } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment