forked from silverstripe/silverstripe-framework
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
See silverstripe/silverstripe-assets#235 Makes a start at silverstripe/silverstripe-assets#219 as well
- Loading branch information
Showing
5 changed files
with
225 additions
and
32 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace SilverStripe\Logging; | ||
|
||
use Monolog\Handler\AbstractProcessingHandler; | ||
|
||
/** | ||
* Echo the output as preformatted HTML, emulating console output in a browser. | ||
* Tiding us over until we can properly decoupled web from CLI output. | ||
* Do not use this API outside of core modules, | ||
* it'll likely be removed as part of a larger refactor. | ||
* | ||
* See https://github.com/silverstripe/silverstripe-framework/issues/5542 | ||
* | ||
* @experimental | ||
*/ | ||
class PreformattedEchoHandler extends AbstractProcessingHandler | ||
{ | ||
|
||
/** | ||
* @param array $record | ||
* @return bool | ||
*/ | ||
protected function write(array $record) | ||
{ | ||
echo sprintf('<pre>%s</pre>', htmlspecialchars($record['formatted'], ENT_QUOTES, 'UTF-8')); | ||
} | ||
} |