PHP code example of tlwl / supports

1. Go to this page and download the library: Download tlwl/supports 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/ */

    

tlwl / supports example snippets


use Tlwl\Supports\Logger;
use Monolog\Logger;

class ApplicationLogger extends Logger
{
    /**
     * Make a default log instance.
     *
     * @author tlwl <[email protected]>
     *
     * @return Logger
     */
    public static function createLogger()
    {
        $handler = new StreamHandler('./log.log');
        $handler->setFormatter(new LineFormatter("%datetime% > %level_name% > %message% %context% %extra%\n\n"));

        $logger = new Logger('tlwl.private_number');
        $logger->pushHandler($handler);

        return $logger;
    }
}

use Tlwl\Supports\Logger;

protected function registerLog()
{
    $logger = Logger::createLogger($file, $identify, $level);

    Logger::setLogger($logger);
}

use Tlwl\Supports\Logger;

Logger::debug('test', ['test log']);