Use class constants from MDConsole to MDOutputHandler
This commit is contained in:
@ -51,7 +51,7 @@ class MDOutputHandler {
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setVerbosity(int $input = 0) {
|
||||
final public function setVerbosity(int $input = 0):void {
|
||||
|
||||
$this->_verbosity = $input;
|
||||
|
||||
@ -64,7 +64,7 @@ class MDOutputHandler {
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setContext(string $input = "") {
|
||||
final public function setContext(string $input = ""):void {
|
||||
|
||||
$this->_context = $input;
|
||||
|
||||
@ -77,7 +77,7 @@ class MDOutputHandler {
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setFileLogging(bool $input = false) {
|
||||
final public function setFileLogging(bool $input = false):void {
|
||||
|
||||
$this->_file_logging = $input;
|
||||
|
||||
@ -101,23 +101,26 @@ class MDOutputHandler {
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function toLog(string $msg, int $statusCode = 0) {
|
||||
final public function toLog(string $msg, int $statusCode = 0):void {
|
||||
|
||||
// Get parts for generating the message to log.
|
||||
$this->_counter++; // Increment counter
|
||||
$date = date("Y-m-d H:i:s"); // Get current date & time.
|
||||
|
||||
switch ($statusCode) {
|
||||
case 1:
|
||||
case MDConsole::STATUS_SKIPPED:
|
||||
$statusSymbol = "-";
|
||||
break;
|
||||
case 2:
|
||||
case MDConsole::STATUS_UPDATE:
|
||||
$statusSymbol = "U";
|
||||
break;
|
||||
case 3:
|
||||
case MDConsole::STATUS_ERROR:
|
||||
$statusSymbol = "E";
|
||||
break;
|
||||
case 0:
|
||||
case MDConsole::STATUS_DELETION:
|
||||
$statusSymbol = "D";
|
||||
break;
|
||||
case MDConsole::STATUS_NOTICE:
|
||||
default:
|
||||
$statusSymbol = "N";
|
||||
break;
|
||||
@ -145,7 +148,7 @@ class MDOutputHandler {
|
||||
/**
|
||||
* Constructor function that sets defaults and ensures the logfile exists.
|
||||
*/
|
||||
function __construct() {
|
||||
public function __construct() {
|
||||
|
||||
$this->_startTime = microtime(true);
|
||||
$this->_counter = 0;
|
||||
|
Reference in New Issue
Block a user