mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
MainLogger: Colorize at point of echo, not beforehand
this removes the need for a hack I had to do with ClientConsole to translate ANSI colour codes back into MC colour codes.
This commit is contained in:
parent
5c66c615bf
commit
b96adda14d
@ -214,13 +214,13 @@ class MainLogger extends \AttachableThreadedLogger{
|
||||
$threadName = (new \ReflectionClass($thread))->getShortName() . " thread";
|
||||
}
|
||||
|
||||
$message = Terminal::toANSI(TextFormat::AQUA . "[" . date("H:i:s", $now) . "] " . TextFormat::RESET . $color . "[" . $threadName . "/" . $prefix . "]:" . " " . $message . TextFormat::RESET);
|
||||
$message = TextFormat::AQUA . "[" . date("H:i:s", $now) . "] " . TextFormat::RESET . $color . "[" . $threadName . "/" . $prefix . "]:" . " " . $message . TextFormat::RESET;
|
||||
$cleanMessage = TextFormat::clean($message);
|
||||
|
||||
if(!Terminal::hasFormattingCodes()){
|
||||
echo $cleanMessage . PHP_EOL;
|
||||
if(Terminal::hasFormattingCodes()){
|
||||
echo Terminal::toANSI($message) . PHP_EOL;
|
||||
}else{
|
||||
echo $message . PHP_EOL;
|
||||
echo $cleanMessage . PHP_EOL;
|
||||
}
|
||||
|
||||
foreach($this->attachments as $attachment){
|
||||
|
Loading…
x
Reference in New Issue
Block a user