2017 © Pedro Peláez
 

library utildebug

开发者在业务上主动触发用户级别的错误

image

nicecp/utildebug

开发者在业务上主动触发用户级别的错误

  • Saturday, February 24, 2018
  • by null
  • Repository
  • 1 Watchers
  • 0 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

UtilDebug

由程序员主动在业务上调用,触发Error Log,不同于fpm日志,此日志产生单独的文件,便于开发者查看及定位, (*1)

需开启fpm错误日志,且UtilDebug日志将与error_log在同一目录下,按日期自动归档日志, (*2)

配置

// php.ini
display_errors = "On"  // 开启fpm错误日志
error_log = /tmp/fpm.error.log  // 路径

使用

<?php
  // 只适用于DAEMON进程,或者未重置请求上下文时有效
  \UtilDebug\UtilDebug::getLastError();

  // Config file name
  \UtilDebug\UtilDebug::config('app.log');

  // Notice
  \UtilDebug\UtilDebug::notice("message");
  \UtilDebug\UtilDebug::notice("message", new \Exception("Notice"));

  // Warning
  \UtilDebug\UtilDebug::warning("message");
  \UtilDebug\UtilDebug::warning("message", new \Exception("Warning"));

  // Error
  \UtilDebug\UtilDebug::error("message");
  \UtilDebug\UtilDebug::error("message", new \Exception("Error"));

The Versions

24/02 2018

dev-master

9999999-dev http://www.iyov.io

开发者在业务上主动触发用户级别的错误

  Sources   Download

MIT

The Requires

  • php >=5.3

 

debug util error log trigger error

24/02 2018

1.0

1.0.0.0 http://www.iyov.io

开发者在业务上主动触发用户级别的错误

  Sources   Download

MIT

The Requires

  • php >=5.3

 

debug util error log trigger error