PHP code example of galancev / console-log

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

    

galancev / console-log example snippets


$log = new ConsoleLog();

$log->text('Вывести текст');

[13-11-2018 12:44:39] Вывести текст

$log->error('Ошибка!');

$log->warning('Внимание!');

$log->success('Успех :)');

$log->dump($log);

$log->setShowLabels(false);

$log->setUseTimestamps(false);

$log->setTimeFormat('d-m-Y H:i:s');

$log->setOutputToConsole(false);

$log->setOutputToBuffer(false);

$log->setOutputOnlyIfError(true);

$log->clear();

$log->get();

$log->save('filename.txt', true);

$log->setLogCallback(function() {});