-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/initial-version'
- Loading branch information
Showing
10 changed files
with
3,526 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
composer.phar | ||
/vendor/ | ||
|
||
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control | ||
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file | ||
# composer.lock | ||
/coverage/ | ||
*.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
language: php | ||
|
||
sudo: false | ||
|
||
php: | ||
- 7.1 | ||
- 7.2 | ||
|
||
cache: | ||
directories: | ||
- $HOME/.composer/cache | ||
|
||
before_script: | ||
- composer install --prefer-source --no-interaction --dev | ||
|
||
script: composer tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,37 @@ | ||
# monolog-wp-cli | ||
Extension for Monolog to support outputting to WP-CLI when running wp command lines. | ||
# Monolog WP-CLI Handler | ||
|
||
[![Build Status](https://img.shields.io/travis/com/mhcg/monolog-wp-cli.svg)](https://travis-ci.com/mhcg/monolog-wp-cli) | ||
[![Latest Stable Version](https://img.shields.io/packagist/v/mhcg/monolog-wp-cli.svg)](https://packagist.org/packages/mhcg/monolog-wp-cli) | ||
|
||
Handler for [Monolog](https://github.com/Seldaek/monolog) to support outputting to WP-CLI when running wp command lines. | ||
|
||
## Installation | ||
Install the latest version with Composer. | ||
|
||
`$ composer require mhcg/monolog-wp-cli` | ||
|
||
## Basic Usage | ||
|
||
```php | ||
<?php | ||
|
||
use Monolog\Logger; | ||
use MHCG\Monolog\Handler; | ||
|
||
// create a log channel | ||
$log = new Logger( 'name' ); | ||
$log->pushHandler( new WPCLIHandler( Logger::WARNING ) ); | ||
|
||
// output to WP-CLI | ||
$log->warning( 'This is a warning' ); | ||
$log->error( 'An error has occurred' ); | ||
$log->critical( 'This will report error and exit out' ); | ||
``` | ||
|
||
## Author | ||
Mark Heydon <[contact@mhcg.co.uk](contact@mhcg.co.uk)> | ||
|
||
## License | ||
Monolog is licensed under the MIT License and therefore so is this handler - see the LICENSE file for details. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"name": "mhcg/monolog-wp-cli", | ||
"description": "Monolog handler to support WP-CLI calls", | ||
"keywords": [ | ||
"log", | ||
"logging", | ||
"psr-3", | ||
"wp-cli" | ||
], | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Mark Heydon", | ||
"email": "contact@mhcg.co.uk", | ||
"role": "Developer" | ||
} | ||
], | ||
"type": "library", | ||
"require": { | ||
"php": ">=7.1", | ||
"monolog/monolog": "~1" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "^6.5", | ||
"jakub-onderka/php-parallel-lint": "^0.9", | ||
"squizlabs/php_codesniffer": "^3.3", | ||
"friendsofphp/php-cs-fixer": "^2.13" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"MHCG\\Monolog\\": "src/Monolog" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"MHCGDev\\Monolog\\": "tests/Monolog" | ||
} | ||
}, | ||
"scripts": { | ||
"tests": "composer fixes && composer sniffs && composer lints && phpunit --coverage-clover coverage/clover.xml", | ||
"sniffs": "phpcs --standard=PSR2 src/ && phpcs --standard=PSR2 tests/", | ||
"fixes": "php-cs-fixer fix src/ && php-cs-fixer fix tests/", | ||
"lints": "parallel-lint ./src --blame --exclude vendor && parallel-lint ./tests --blame --exclude vendor" | ||
} | ||
} |
Oops, something went wrong.