marc / epilog
Epilog 是一款具有风格的 CLI 日志查看器
1.0.1
2015-05-14 03:36 UTC
Requires
- docopt/docopt: ~1.0
- igorw/get-in: ~1.0
- minime/annotations: ~2.3
- regex-guard/regex-guard: ~1.0
- symfony/yaml: 2.5.3
Requires (Dev)
- mikey179/vfsstream: ~1.2.0
- mockery/mockery: dev-master
README
轻量级、可主题化和交互式的 PSR-3 日志查看器。以风格化的方式监控 monolog
安装
作为 composer 项目的依赖项
{ "require": { "marc/epilog": "~1.0" } }
作为打包的 phar
wget https://github.com/marcioAlmada/epilog/raw/master/bin/epilog && chmod +x epilog mv epilog /usr/local/bin/ # or somewhere in your $PATH
作为 composer 全局包
composer global require marc/epilog:~1.0
或者自己构建 phar
# install box2 -> https://github.com/box-project/box2 git clone https://github.com/marcioAlmada/epilog.git cd epilog composer install make # phar will available at bin/ folder sudo make install # will put epilog at /usr/local/bin/ folder
快速测试
运行 epilog pretend
命令并跟踪假日志流。检查输出是否良好
epilog pretend
用法
基本用法是
epilog watch /path/to/monolog/file.log [<args>]...
当 epilog 正在监控日志文件(或假流)时,按 [return]
键以查看一个漂亮的交互式菜单
$ [ ⏎ ]
Woot! Epilog here. Please type a theme number, a valid regexp or a valid flag:
[#] load another theme:
1:chaplin 2:forest
3:scrapbook 4:punchcard
5:sunset 6:sunrise
7:traffic 8:usa
[ r ] load random theme from list above.
[ i ] toggle invert theme.
[ c ] clear screen.
[ - ] reset regexp filter.
[ q ] quit.
框架集成
Epilog 可以使用 日志查找器 根据框架约定在应用目录中查找日志,这样您就不需要手动定位最新的日志文件。例如
$ epilog watch ~/www/my-project --app laravel # instead of long and boring $ epilog watch ~/www/my-project/app/storage/logs/log-cli-server-2015-01-11.txt
鼓励为支持您选择的框架实现日志查找器的 PR
主题
Epilog 主题是非常简单的 yml
文件,其中包含钩子,您可以在其中放置 ANSI 颜色转义序列和纯文本。这些钩子将装饰每一行日志,nyancatyze 您的终端,有时甚至 puke rainbows。以下是一个主题示例
name: Punched Card author: Márcio Almada theme: extends: default # the log line template # template tags are: {date}, {level}, {logger}, {message}, {context}, {extra} template: "{level} {date} {message} [{logger}] [{context}] [{extra}]" # literal string that will be prepended to entire line prepend: "" # literal string that will be appended to entire line append: "\e[0m\n" # level section level: padding: 10 DEBUG: prepend: " • \e[2m" INFO: prepend: " • \e[2m" NOTICE: prepend: " • \e[2m" WARNING: prepend: " • \e[2m" ERROR: prepend: " • \e[1m" CRITICAL: prepend: " • \e[1m" ALERT: prepend: " • \e[1m" EMERGENCY: prepend: " • \e[1m" DEFAULT: prepend: " -------- \e[1m"
当解释时,这将使日志行看起来像以下内容
路线图
- 基本功能
- 添加
--app
选项以允许轻松集成框架。例如:epilog watch /my/project --app laravel
- 添加
listen
命令以通过 REST API 聚集日志条目。例如:epilog listen --port 8888
- 添加
server
命令以在浏览器中查看日志而不是终端epilog server <file> --port 8888
- 添加更好的 Unicode 支持、更多主题等
- 麻烦 Windows ... 有人在用吗?
- 其他酷炫的事情,可能吧
- 发布稳定版本
贡献
发现错误?有改进建议?请查看 问题。
指南
- 分支 marc/epilog
- 克隆分支的仓库
- 安装 composer 依赖项
$ composer install
- 运行单元测试
$ phpunit
- 修改代码:修复错误,实现功能
- 返回步骤 4
版权
版权(c)2014-2015 Márcio Almada。根据 MIT 风格许可协议分发。有关详细信息,请参阅 LICENSE。