/stdlog

Log output to STDOUT and STDERR.

Primary LanguagePHPMIT LicenseMIT

Stdlog

Use this psr/log implementation for logging output to STDOUT and STDERR.

Great for logging to console output ...

use pmjones\Stdlog\Stdlog;

$log = new Stdlog();

// info level logs to STDOUT
$log->info('Hello world!');

// all other levels log to STDERR
$log->error('Other world!');

... or to streams:

use pmjones\Stdlog\Stdlog;

$log = new Stdlog(
    stdout: fopen('php://memory', 'w'),
    stderr: fopen('php://memory', 'w')
);

// info level logs to STDOUT
$log->info('Hello world!');

// all other levels log to STDERR
$log->error('Other world!');