Created
April 18, 2017 06:05
-
-
Save sminnee/5316bbd515b126270da4a40203d8b0a3 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
| diff --git a/src/Dev/Debug.php b/src/Dev/Debug.php | |
| index 06d7ec9..38f1947 100644 | |
| --- a/src/Dev/Debug.php | |
| +++ b/src/Dev/Debug.php | |
| @@ -8,6 +8,8 @@ use SilverStripe\Core\Injector\Injector; | |
| use SilverStripe\ORM\DB; | |
| use SilverStripe\Security\Permission; | |
| use SilverStripe\Security\Security; | |
| +use Psr\Log\LoggerInterface; | |
| + | |
| /** | |
| * Supports debugging and core error handling. | |
| @@ -161,20 +163,7 @@ class Debug | |
| public static function message($message, $showHeader = true) | |
| { | |
| if (!Director::isLive()) { | |
| - $caller = Debug::caller(); | |
| - $file = basename($caller['file']); | |
| - if (Director::is_cli()) { | |
| - if ($showHeader) { | |
| - echo "Debug (line $caller[line] of $file):\n "; | |
| - } | |
| - echo $message . "\n"; | |
| - } else { | |
| - echo "<p class=\"message warning\">\n"; | |
| - if ($showHeader) { | |
| - echo "<b>Debug (line $caller[line] of $file):</b>\n "; | |
| - } | |
| - echo Convert::raw2xml($message) . "</p>\n"; | |
| - } | |
| + Injector::inst()->get(LoggerInterface::class)->debug($message); | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment