pmjones / stdlog

Log output to STDOUT and STDERR.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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!');

About

Log output to STDOUT and STDERR.

License:MIT License


Languages

Language:PHP 100.0%