PHP code example of volnix / jobber

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

    

volnix / jobber example snippets


use Volnix/Jobber/Printer;

Printer::start('my_job_name');
Printer::info('Something happened, but it is not super important.');
Printer::stop();

Printer::start('my_job_name');
Printer::info('Something happened, but it is not super important.');
Printer::stop();

$my_logger->info(Printer::getOutput());

// turn off verbosity, disabling info messages
Printer::setVerbosity(false);

// do job 1
Printer::start('job_number_1');
// do something in your code...
Printer::success('Something good happened.');
Printer::stop();

// reset the printer
Printer::reset();

// start job 2
Printer::start('job_number_2');
// ...

// printing with tokens
Printer::start('something job');
Printer::info('Exported %d records to %s.', [10, '/filepath/something/here.txt']); // "Exported 10 records to /filepath/something/here.txt"

***************************************************
2015-01-23 15:52:35 - Starting test_name

INFO: 2015-01-23 15:52:35 - foo
WARNING: 2015-01-23 15:52:35 - bar
SUCCESS: 2015-01-23 15:52:35 - baz
ERROR: 2015-01-23 15:52:35 - qux

2015-01-23 15:52:35 - Execution Time: 0.0 seconds / Peak memory usage: 3.22 Mb
***************************************************