pmjones/stdlog

Log output to STDOUT and STDERR.

1.0.0 2023-05-10 21:26 UTC

This package is auto-updated.

Last update: 2024-10-15 04:22:45 UTC


README

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