lushobarlett/cologger
Composer 安装命令:
composer require lushobarlett/cologger
包简介
simple logger
README 文档
README
Very simple PHP Logger with colors
Use
By default the logger will output to a file in the directory that the file resides in with the name 'cologger.log'.
This (and console output) can be changed.
The class uses Linux console text modifiers ( \e[...m ), this has not been tested on Windows.
Notice: to write to a file, the process trying to do it needs to have file creation and file writing permissions.
Functions
$logger = new Logger; $logger->error("error"); $logger->warning("warning"); $logger->notice("notice"); $logger->log("normal");
Errors will be red, Warnings will be orange, Notices will be green and Logs will be white. Each log will be placed in a new line with data about the date and time of logging.
Parameters
The first parameter is a string representing the location of the file. The second argument is a boolean, defaulted to false, to write to console instead.
$logger = new Logger("mytarget.log"); $console = new Logger("doesn't matter", true);
Future Features
- Formatting the log metadata.
- Changing the color scheme.
- Adding color to the message itself (without doing it by hand)
- Quick and better way to change logging targets
统计信息
- 总下载量: 319
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-02-15