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

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

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

simpliste/log

Composer 安装命令:

composer require simpliste/log

包简介

Implementation of the LoggerAwareInterface

README 文档

README

Build Status Code Coverage Scrutinizer Code Quality Software License

LoggerAwareTrait implementation of the LoggerAwareInterface.

With the LoggerAwareTrait you can use log functions without knowing or the logger is set. When the logger is not set a NullLogger is returned so that the code does not break.

Installation

You can install simpliste log through Composer:

$ composer require simpliste/log

You can combine this LoggerAwareTrait with anything that implements the Psr\Log\LoggerInterface. For example Monolog can be used.

$ composer require monolog/monolog

Usage

<?php

use Monolog\Handler\Handler\StreamHandler;
use Monolog\Logger;
use Simpliste\Log\LoggerAwareTrait;
use Simpliste\Log\LoggerAwareInterface;

class Whoops implements LoggerAwareInterface
{
    use LoggerAwareTrait;
    
    public function run()
    {
        $this->getLogger()->info('Started running');
    }
}

echo 'Example without a logger set';
$whoops = new Whoops();
$whoops->run();

$logger = new Logger();
$logger->pushHandler(new StreamHandler('php://stdout', Logger::INFO));

echo 'Example with a logger set';
$whoopsWithLogger = new Whoops();
$whoopsWithLogger->setLogger($logger);

The above example will output:

Example without an logger set
Example with an logger set
Started running

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-05-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固