duon/log 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

duon/log

最新稳定版本:0.2.0

Composer 安装命令:

composer require duon/log

包简介

A simple PSR-3 Logger

README 文档

README

Software License Codacy Badge Codacy Badge Psalm level Psalm coverage

A simple PSR-3 logger using PHP's error_log function.

Installation

composer require duon/log

Usage

Create a logger without arguments to write to PHP's default SAPI error logger.

use Duon\Log\Logger;

$logger = new Logger();
$logger->info('Application started');

See the documentation for file logging, level filtering, and formatter usage.

Testing

During testing, PHP's error_log ini setting is set to a temporary file. To print the output to the console, prepend a special env variable to the PHPUnit cli command, as follows:

ECHO_LOG=1 phpunit

Test Environment Requirements

Tests require:

  • ini_set() function enabled (for error_log redirection)
  • Writable system temp directory (for test log file isolation)
  • PHP error_reporting must be modifiable

These are standard in development environments but may fail in restricted PHP configurations where ini_set is disabled via disable_functions.

License

This project is licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-04-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固