lilei / my-mono-log
v1.0
2021-12-21 04:02 UTC
Requires
- monolog/monolog: ^2.3
- phpunit/phpunit: ^9.5
This package is not auto-updated.
Last update: 2025-04-28 16:00:17 UTC
README
对 monolog/monolog
扩展包进行封装、调整,让其在项目里简单易用。
安装
$ composer require lilei/my-mono-log
日志输出目录
project_root/monolog/
,如果你需要修改的日志输出目录,请自行修改
src\MyMonoLog.php->setDirname()
$MyMonoLog = new MyMonoLog();
$MyMonoLog->setDirname("my-dirname")->write(string $channel, string|array $message);
package
使用到的扩展包:
- monolog/monolog
- phpunit/phpunit
测试
$ vendor/bin/phpunit tests/MyMonoLogTest.php --filter testWrite
$ vendor/bin/phpunit tests/MyMonoLogTest.php --filter testInfo
使用
$MyMonoLog = new MyMonoLog();
$MyMonoLog->write(string $channel, string|array $message);
$MyMonoLog->channel(string $channel)->info(string|array $message);