Welcome to mirror list, hosted at ThFree Co, Russian Federation.

EchoHandler.php « Handler « Monolog « plugins - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cf8cc6662cb1faa12d0d010febce99431106644f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
/**
 * Piwik - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */

namespace Piwik\Plugins\Monolog\Handler;

use Monolog\Handler\AbstractProcessingHandler;

/**
 * Simply echos all messages.
 */
class EchoHandler extends AbstractProcessingHandler
{
    protected function write(array $record)
    {
        if (isset($record['formatted'])) {
            $message = $record['formatted'];
        } else {
            $message = $record['level_name'] . ': ' . $record['message'];
        }

        echo $message . "\n";
    }
}