Download the PHP package brianhenryie/bh-wp-cli-logger without Composer

On this page you can find all versions of the php package brianhenryie/bh-wp-cli-logger. 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 bh-wp-cli-logger

WP CLI PSR Logger

A PSR logger which calls WP_CLI::line() with the level name coloured.

Allows easy separation of logic and presentation for CLI commands. I.e. no intermingling of WP_CLI::line() in main application code.

Install

Operation

There is one filter for customising the output:

Try it out

The test plugin CLI command has two options, levels and message:

Delete the Docker containers afterwards:

Rationale

Error: red, warning: yellow, and notice: blue are the standard WordPress admin_notice colours.

Debug: blue is the standard WP_CLI debug colour.

Emergency, alert and critical use WP_CLI::error_multi_line().

Info logs are not prepended with "Info: ", as other levels are. I'm not 100% set on this.

TODO

Level Filtering

I imagine there is a Composer package that provides the same utility as WooCommerce's WC_Logger::should_handle() function, and is extensible. If I come across one, I'll include it here.

When WP CLI commands are appended with --debug or more specifically --debug=my-plugin-slug, all messages should be output. This should be part of any ::should_handle() function.

psr/log >=2.0

This currently requires "psr/log": "^1.0". v2.0 requires PHP 8.0 and introduces parameter types; 3.0 then introduces return types.

Context

Context is not printed.

See Also


All versions of bh-wp-cli-logger with dependencies

PHP Build Version
Package Version
Requires psr/log Version ^1.0
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 brianhenryie/bh-wp-cli-logger contains the following files

Loading the files please wait ....