curruwilla/console-pretty-log 问题修复 & 功能扩展

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

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

curruwilla/console-pretty-log

最新稳定版本:1.4

Composer 安装命令:

composer require curruwilla/console-pretty-log

包简介

Simple and customizable console log output for CLI apps.

README 文档

README

PHP from Packagist Latest Version Software License Build Quality Score Total Downloads

Simple and customizable console log output for CLI apps.

Highlights

  • Simple installation (Instalação simples)
  • Very easy to customize text output (Muito fácil de customizar a saída de texto)
  • Composer ready and PSR-12 compliant (Pronto para o composer e compatível com PSR-12)

Installation

Uploader is available via Composer:

"curruwilla/console-pretty-log": "^1.0"

or run

composer require curruwilla/console-pretty-log

Documentation

Check the example file.

If you are defining the size of columns, when using textInitial be sure to enter the size as well.

Example:

use ConsolePrettyLog\Background;
use ConsolePrettyLog\Color;
use ConsolePrettyLog\Font;
use ConsolePrettyLog\Line;

$line = new Line();
$line->columnsSize([15, 75, 10]); // <-- Use to keep information aligned
//$line->separator('-'); <-- Default value: '|'
//$line->paddingCharacter(' '); <-- Default value: '.'
//$line->enableDate(false); <-- Default value: true
//$line->dateFormat("d/m/Y H:i"); <-- Default value: 'Y-m-d H:i:s'
//$line->textInitial('LOG', [Color::RED, Font::BOLD]); <-- Include text at the beginning of every line
//$line->textInitial('IMPORTANT', [Font::BOLD]); <-- Include text at the beginning of every line

$line
    ->text('Account 1', [Font::BOLD, Font::ITALIC])
    ->text('Delivery made successfully', [Color::WHITE])
    ->text('Success', [Color::GREEN])
    ->print();

$line
    ->text('Account 2', [Font::BOLD])
    ->text('Opps, something went wrong with the delivery, please see the log', [Color::WHITE])
    ->text('Error', [Background::RED])
    ->print();

$line
    ->text('Account 3', [Font::BOLD])
    ->text('Payment made successfully', [Color::WHITE, Font::ITALIC])
    ->text('SUCCESS', [Background::GREEN])
    ->print();

$line
    ->text('Account 1', [Font::BOLD])
    ->text('Payment made successfully', [Color::WHITE])
    ->text('INFO', [Background::BLUE])
    ->print();

Result in CLI:

example.png

Enums Options:

options_enums.png

Contributing

Please see CONTRIBUTING for details.

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-07-31

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固