PHP class for output strings, objects, etc. to terminal (console) with colors, background colors and styles.
####Simple output
$obj = <standart type, array, object>
ConsoleLog::output($obj);####Extended output
ConsoleLog::title('Cyan title');
ConsoleLog::warning('Yellow warning');
ConsoleLog::error('Red error');
ConsoleLog::ok(); // green OKAny output methods has last parameter $useNewLine=true, which automatically added new line at the end of the line. Thats why you can write difficult output like:
ConsoleLog::title('Title withoud EOL ', false);
ConsoleLog::warning('Warning without EOL ', false);
ConsoleLog::eol();
ConsoleLog::output('Text without EOL ', false);
ConsoleLog::ok(); // output green OK and EOLConsoleLog::progress('Some process text', $currentIdx, $totalIdx, $progressWidth);NOTE: $currentIdx and $totalIdx started at 1.
ConsoleLog::addIndent();
ConsoleLog::output('smth');
ConsoleLog::removeIndent();ConsoleLog::setStyle('green', 'yellow', array('bold', 'negative')); // color, bgcolor, array(styles)
ConsoleLog::output('smth');
ConsoleLog::resetStyle();color = [
'gray'
'black'
'red'
'green'
'yellow'
'blue'
'magenta'
'cyan'
'white'
'default'
]
bgcolor = [
'gray'
'black'
'red'
'green'
'yellow'
'blue'
'magenta'
'cyan'
'white'
'default'
]
style = [
'default'
'bold'
'faint'
'normal'
'italic'
'notitalic'
'underlined'
'doubleunderlined'
'notunderlined'
'blink'
'blinkfast'
'noblink'
'negative'
'positive'
]