| 1 |
<?php |
| 2 |
|
| 3 |
namespace WebPConvert\Loggers; |
| 4 |
|
| 5 |
/** |
| 6 |
* Base for all logger classes. |
| 7 |
* |
| 8 |
* WebPConvert can provide insights into the conversion process by means of accepting a logger which |
| 9 |
* extends this class. |
| 10 |
* |
| 11 |
* @package WebPConvert |
| 12 |
* @author Bjørn Rosell <[email protected]> |
| 13 |
* @since Class available since Release 2.0.0 |
| 14 |
*/ |
| 15 |
abstract class BaseLogger |
| 16 |
{ |
| 17 |
/** |
| 18 |
* Write a message to the log |
| 19 |
* |
| 20 |
* @param string $msg message to log |
| 21 |
* @param string $style style (null | bold | italic) |
| 22 |
* @return void |
| 23 |
*/ |
| 24 |
abstract public function log($msg, $style = ''); |
| 25 |
|
| 26 |
/** |
| 27 |
* Add new line to the log |
| 28 |
* @return void |
| 29 |
*/ |
| 30 |
abstract public function ln(); |
| 31 |
|
| 32 |
/** |
| 33 |
* Write a line to the log |
| 34 |
* |
| 35 |
* @param string $msg message to log |
| 36 |
* @param string $style style (null | bold | italic) |
| 37 |
* @return void |
| 38 |
*/ |
| 39 |
public function logLn($msg, $style = '') |
| 40 |
{ |
| 41 |
$this->log($msg, $style); |
| 42 |
$this->ln(); |
| 43 |
} |
| 44 |
} |
| 45 |
|