PHP code example of phel-lang / phel-log

1. Go to this page and download the library: Download phel-lang/phel-log library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

phel-lang / phel-log example snippets


use Phel\PhelLog\PsrLogger;

$dispatcher = static function (string $level, string $message, array $ctx): void {
    \Phel::run('my-bootstrap', 'log-from-psr', $level, $message, $ctx);
};

$logger = new PsrLogger($dispatcher, channel: 'symfony');
$container->set(\Psr\Log\LoggerInterface::class, $logger);