enrise/psr-log-extension 问题修复 & 功能扩展

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

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

enrise/psr-log-extension

最新稳定版本:1.0.1

Composer 安装命令:

composer require enrise/psr-log-extension

包简介

An extension to the Psr\Log package

README 文档

README

Latest Stable Version License

This repository contains an extension on the LoggerAwareTrait that comes with the Psr\Log package. It contains convenience methods to use the LoggerAwareInterface implementation in a safe way. Meaning you don't have to care whether the class you're implementing actually has a logger instance attached to it.

Usage example

The example below works whether a logger instance has been attached or not.

use Psr\Log\LoggerAwareInterface;
use Enrise\Log\LoggerAwareTrait;

class Foo implements LoggerAwareInterface
{
    use LoggerAwareTrait;

    function bar()
    {
        $this->logDebug('Write a debug statement to the log');
    }
}

$foo = new Foo();
$foo->bar(); // All fine

$foo->setLogger(new ConcreteLogger());
$foo->bar(); // Writes to the logger as usual

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-03-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固