lilei/my-mono-log

v1.0 2021-12-21 04:02 UTC

This package is not auto-updated.

Last update: 2024-04-15 11:29:52 UTC


README

monolog/monolog 扩展包进行封装、调整,让其在项目里简单易用。

安装

lilei/my-mono-log

$ 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);