extract the success/failure logging of the builder to an interface.
This commit is contained in:
parent
912776801d
commit
6aed18158b
3 changed files with 42 additions and 11 deletions
31
PHPCI/BuildLogger.php
Normal file
31
PHPCI/BuildLogger.php
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
namespace PHPCI;
|
||||
|
||||
use Psr\Log\LogLevel;
|
||||
|
||||
/**
|
||||
* PHPCI Build Logger
|
||||
*/
|
||||
interface BuildLogger
|
||||
{
|
||||
/**
|
||||
* Add an entry to the build log.
|
||||
* @param string|string[] $message
|
||||
* @param string $level
|
||||
* @param mixed[] $context
|
||||
*/
|
||||
public function log($message, $level = LogLevel::INFO, $context = array());
|
||||
|
||||
/**
|
||||
* Add a success-coloured message to the log.
|
||||
* @param string
|
||||
*/
|
||||
public function logSuccess($message);
|
||||
|
||||
/**
|
||||
* Add a failure-coloured message to the log.
|
||||
* @param string $message
|
||||
* @param \Exception $exception The exception that caused the error.
|
||||
*/
|
||||
public function logFailure($message, \Exception $exception = null);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue