PHP code example of brianhenryie / bh-wp-cli-logger

1. Go to this page and download the library: Download brianhenryie/bh-wp-cli-logger library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

brianhenryie / bh-wp-cli-logger example snippets


$logger = new \BrianHenryIE\WP_CLI_Logger\WP_CLI_Logger();
$logger->warning( 'Something happened!' );

/**
 * Filter logs to control output style.
 *
 * NB: try to use the `context` to only apply this filter to logs output by your own plugin.
 * Return null, an empty array, or an empty message to prevent output.
 *
 * @var ?array{level:string, message:string, context:array<mixed>, prepend:string, ansi_color:string} $log
 */
$log = apply_filters( 'bh_wp_cli_logger_log', $log );