1. Go to this page and download the library: Download sensorario/yaphlo 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/ */
sensorario / yaphlo example snippets
ensorario\Yaphlo\Logger;
use Sensorario\Yaphlo\Message;
use Sensorario\Yaphlo\Writer;
use Sensorario\Yaphlo\WriterAdapter;
use Sensorario\Yaphlo\Config;
use Sensorario\Yaphlo\ArrayConfig;
use Sensorario\Yaphlo\CustomConfig;
$logger = new Logger(
new Message,
new Writer(
new CustomConfig(
Message::LEVEL_INFO,
['channel A'],
),
new WriterAdapter(
__DIR__ . '/logger.log',
)
)
);
$logger->info(['write' => 'this']);
$logger->error(['write' => 'this']);
$logger->info(['write' => 'this'], 'channel A');
$logger->info(['write' => 'this'], 'channel B');
ensorario\Yaphlo\Logger;
use Sensorario\Yaphlo\Message;
use Sensorario\Yaphlo\Writer;
use Sensorario\Yaphlo\WriterAdapter;
$config = [
'logger' => [
'level' => 'INFO',
'enabledChannels' => [
'channel A',
],
],
];
$logger = new Logger(
new Message,
new Writer(
new ArrayConfig($config),
new WriterAdapter(
__DIR__ . '/logger.log',
)
)
);
$logger->info(['write' => 'this']);
$logger->error(['write' => 'this'], 'channel A');
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.