Download the PHP package bramus/monolog-colored-line-formatter without Composer

On this page you can find all versions of the php package bramus/monolog-colored-line-formatter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package monolog-colored-line-formatter

Monolog Colored Line Formatter

Build Status Source Supported PHP Versions Version Downloads License

A Formatter for Monolog with color support Built by Bramus! - https://www.bram.us/

About

bramus/monolog-colored-line-formatter is a formatter for use with Monolog. It augments the Monolog LineFormatter by adding color support. To achieve this bramus/monolog-colored-line-formatter uses ANSI Escape Sequences – provided by bramus/ansi-php – which makes it perfect for usage on text based terminals (viz. the shell).

bramus/monolog-colored-line-formatter ships with a default color scheme, yet it can be adjusted to fit your own needs.

Prerequisites/Requirements

Looking for a version compatible with Monolog 1.x? Check out the monolog-1.x branch then. The version of monolog-colored-line-formatter that is compatible with Monolog 1.x, is monolog-colored-line-formatter version ~2.0

Looking for a version compatible with Monolog 2.x? Check out the monolog-2.x branch then. The version of monolog-colored-line-formatter that is compatible with Monolog 1.x, is monolog-colored-line-formatter version ~3.0.0

Installation

Installation is possible using Composer.

Install monolog-colored-line-formatter, compatible with Monolog 3.x:

Install monolog-colored-line-formatter, compatible with Monolog 2.x:

Install monolog-colored-line-formatter, compatible with Monolog 1.x:

Usage

Create an instance of \Bramus\Monolog\Formatter\ColoredLineFormatter and set it as the formatter for the \Monolog\Handler\StreamHandler that you use with your \Monolog\Logger instance.

Color Schemes

Available Color Schemes

Color Scheme: DefaultScheme

Monolog Colored Line Formatter

Color Scheme: TrafficLight

Monolog Colored Line Formatter

Activating a Color Scheme

Color Schemes are defined as classes. If you do not provide any color scheme the default one will be used.

To activate a color scheme pass it as the first argument of the ColoredLineFormatter Constructor. All successive arguments are the ones as required by the \Monolog\Formatter\LineFormatter class.

Alternatively it's also possible to activate it using the setColorScheme() method of a ColoredLineFormatter instance.

Creating your own Custom Color Scheme

To define your own color scheme make a class that implements the \Bramus\Monolog\Formatter\ColorSchemes\ColorSchemeInterface interface. To make things more easy a trait ColorSchemeTrait is defined.

Please refer to the bramus/ansi-php documentation to define your own styles and colors.

Unit Testing

bramus/monolog-colored-line-formatter ships with unit tests using PHPUnit.

Unit tests are also automatically run on GitHub Actions

License

bramus/monolog-colored-line-formatter is released under the MIT public license. See the enclosed LICENSE.txt for details.


All versions of monolog-colored-line-formatter with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
monolog/monolog Version ~3.0
bramus/ansi-php Version ^3.0.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bramus/monolog-colored-line-formatter contains the following files

Loading the files please wait ....