TextFormat: Moved toANSI() to Terminal, close #1995

This also removes a cyclic dependency between TextFormat and Terminal, meaning that TextFormat is now standalone without any external dependencies.

This is also an API break. Beware all ye who wander here, master = bleeding-edge!
This commit is contained in:
Dylan K. Taylor
2018-02-11 19:11:51 +00:00
parent 98d6aea7fe
commit b445825467
3 changed files with 95 additions and 95 deletions

View File

@ -214,7 +214,7 @@ class MainLogger extends \AttachableThreadedLogger{
$threadName = (new \ReflectionClass($thread))->getShortName() . " thread";
}
$message = TextFormat::toANSI(TextFormat::AQUA . "[" . date("H:i:s", $now) . "] " . TextFormat::RESET . $color . "[" . $threadName . "/" . $prefix . "]:" . " " . $message . TextFormat::RESET);
$message = Terminal::toANSI(TextFormat::AQUA . "[" . date("H:i:s", $now) . "] " . TextFormat::RESET . $color . "[" . $threadName . "/" . $prefix . "]:" . " " . $message . TextFormat::RESET);
$cleanMessage = TextFormat::clean($message);
if(!Terminal::hasFormattingCodes()){