承接 myena/default-logger 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

myena/default-logger

Composer 安装命令:

composer require myena/default-logger

包简介

A simple PSR-3 compliant logger

README 文档

README

A simple PSR-3 compliant logger

Build Status

Installation

This library is designed to be used with Composer

Require entry:

{
    "myena/default-logger": "@stable"
}

Basic Usage

$logger = new \MyENA\DefaultLogger();

$logger->debug('hello!');

Defaults

The default level of this logger is debug

The default stream for this logger is php://output

Custom Levels

You may specify custom levels one of two ways:

Construction:

$logger = new \MyENA\DefaultLogger(\Psr\Log\LogLevel::INFO);

Post-Construction:

$logger->setLogLevel(\Psr\Log\LogLevel::INFO);

If you attempt to specify a level not denoted by \Psr\Log\LogLevel, an exception will be thrown.

Custom Stream

If you wish for the log output to go to a file or some other resource writeable by the fwrite function, you may pass it in as the 2nd argument.

$logger = new \MyENA\DefaultLogger(\Psr\Log\LogLevel::DEBUG, fopen('tmp/test.log', 'ab'));

If this file becomes un-writeable for some reason, it will attempt to reconstruct the internal resource. If it is unable, it will revert to using the stream returned by the defaultStream().

NOTE: No write-ability determination is done, if you pass in a read-only stream it will ultimately not work.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MPL-2.0
  • 更新时间: 2017-02-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固