定制 effectra/log 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

effectra/log

最新稳定版本:v1.0.0

Composer 安装命令:

composer require effectra/log

包简介

The Effectra Log package.

README 文档

README

Effectra\Log is a logging library that provides a simple and flexible way to handle logging in your PHP applications. It implements the PSR-3 LoggerInterface and includes additional features for log handling.

Installation

You can install the Effectra\Log library via Composer. Run the following command in your project directory:

composer require effectra/log

Usage

To use the Effectra\Log library in your project, follow these steps:

  1. Create an instance of the Logger class:

    use Effectra\Log\Logger;
    
    $logger = new Logger('/path/to/log/file.log');
  2. Start logging messages:

    $logger->info('This is an informational message.');
    $logger->error('An error occurred.', ['context' => 'additional data']);
    // ...
  3. Customize log levels:

    use Effectra\Log\LogLevel;
    
    $logger->log(LogLevel::DEBUG, 'Debug message');
    $logger->log(LogLevel::WARNING, 'Warning message');
    // ...
  4. Set the logger instance on other classes (optional):

    use Effectra\Log\LoggerAware;
    use Psr\Log\LoggerInterface;
    
    class MyClass implements LoggerAware
    {
        public function __construct(LoggerInterface $logger)
        {
            $this->setLogger($logger);
        }
    
        // ...
    }

For more detailed information on the available methods and features, refer to the code documentation and the PSR-3 LoggerInterface documentation.

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository.

License

The Effectra\Log library is open-source software released under the MIT License.

统计信息

  • 总下载量: 25
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-06-20