diff --git a/src/pocketmine/utils/MainLogger.php b/src/pocketmine/utils/MainLogger.php index 0ac15c548..8b44ab432 100644 --- a/src/pocketmine/utils/MainLogger.php +++ b/src/pocketmine/utils/MainLogger.php @@ -177,13 +177,13 @@ class MainLogger extends \AttachableThreadedLogger{ protected function send($message, $level = -1){ $now = time(); - $message = TextFormat::toANSI(TextFormat::AQUA . date("H:i:s", $now) . TextFormat::RESET . " " . $message . TextFormat::RESET . PHP_EOL); + $message = TextFormat::toANSI(TextFormat::AQUA . date("H:i:s", $now) . TextFormat::RESET . " " . $message . TextFormat::RESET); $cleanMessage = TextFormat::clean($message); if(!Terminal::hasFormattingCodes()){ - echo $cleanMessage; + echo $cleanMessage . PHP_EOL; }else{ - echo Terminal::$START_LINE . $message . Terminal::$END_LINE; + echo $message . PHP_EOL; } if($this->attachment instanceof \ThreadedLoggerAttachment){ diff --git a/src/pocketmine/utils/Terminal.php b/src/pocketmine/utils/Terminal.php index 82d6f3a52..6b2971d6d 100644 --- a/src/pocketmine/utils/Terminal.php +++ b/src/pocketmine/utils/Terminal.php @@ -22,10 +22,6 @@ namespace pocketmine\utils; abstract class Terminal{ - - public static $START_LINE = ""; - public static $END_LINE = ""; - public static $FORMAT_BOLD = ""; public static $FORMAT_OBFUSCATED = ""; public static $FORMAT_ITALIC = ""; @@ -67,7 +63,7 @@ abstract class Terminal{ protected static function getEscapeCodes(){ self::$FORMAT_BOLD = `tput bold`; - self::$FORMAT_OBFUSCATED = `tput invis`; + self::$FORMAT_OBFUSCATED = `tput smacs`; self::$FORMAT_ITALIC = `tput sitm`; self::$FORMAT_UNDERLINE = `tput smul`; self::$FORMAT_STRIKETHROUGH = "\x1b[9m"; //`tput `; @@ -102,9 +98,6 @@ abstract class Terminal{ self::$COLOR_AQUA = self::$COLOR_DARK_AQUA = `tput setaf 6`; self::$COLOR_GRAY = self::$COLOR_WHITE = `tput setaf 7`; } - - self::$START_LINE = `tput sc` . "\n" . `tput cuu1` . "\r"; - self::$END_LINE = `tput rc`; } public static function init(){ diff --git a/src/pocketmine/utils/TextFormat.php b/src/pocketmine/utils/TextFormat.php index a35d16a73..69a3060f1 100644 --- a/src/pocketmine/utils/TextFormat.php +++ b/src/pocketmine/utils/TextFormat.php @@ -411,52 +411,52 @@ abstract class TextFormat{ //Colors case TextFormat::BLACK: - $newString .= "\x1b[38;2;0;0;0m"; + $newString .= Terminal::$COLOR_BLACK; break; case TextFormat::DARK_BLUE: - $newString .= "\x1b[38;2;0;0;170m"; + $newString .= Terminal::$COLOR_DARK_BLUE; break; case TextFormat::DARK_GREEN: - $newString .= "\x1b[38;2;0;170;0m"; + $newString .= Terminal::$COLOR_DARK_GREEN; break; case TextFormat::DARK_AQUA: - $newString .= "\x1b[38;2;0;170;170m"; + $newString .= Terminal::$COLOR_DARK_AQUA; break; case TextFormat::DARK_RED: - $newString .= "\x1b[38;2;170;0;0m"; + $newString .= Terminal::$COLOR_DARK_RED; break; case TextFormat::DARK_PURPLE: - $newString .= "\x1b[38;2;170;0;170m"; + $newString .= Terminal::$COLOR_PURPLE; break; case TextFormat::GOLD: - $newString .= "\x1b[38;2;255;170;0m"; + $newString .= Terminal::$COLOR_GOLD; break; case TextFormat::GRAY: - $newString .= "\x1b[38;2;170;170;170m"; + $newString .= Terminal::$COLOR_GRAY; break; case TextFormat::DARK_GRAY: - $newString .= "\x1b[38;2;85;85;85m"; + $newString .= Terminal::$COLOR_DARK_GRAY; break; case TextFormat::BLUE: - $newString .= "\x1b[38;2;85;85;255m"; + $newString .= Terminal::$COLOR_BLUE; break; case TextFormat::GREEN: - $newString .= "\x1b[38;2;85;255;85m"; + $newString .= Terminal::$COLOR_GREEN; break; case TextFormat::AQUA: - $newString .= "\x1b[38;2;85;255;255m"; + $newString .= Terminal::$COLOR_AQUA; break; case TextFormat::RED: - $newString .= "\x1b[38;2;255;85;85m"; + $newString .= Terminal::$COLOR_RED; break; case TextFormat::LIGHT_PURPLE: - $newString .= "\x1b[38;2;255;85;255m"; + $newString .= Terminal::$COLOR_LIGHT_PURPLE; break; case TextFormat::YELLOW: - $newString .= "\x1b[38;2;255;255;85m"; + $newString .= Terminal::$COLOR_YELLOW; break; case TextFormat::WHITE: - $newString .= "\x1b[38;2;255;255;255m"; + $newString .= Terminal::$COLOR_WHITE; break; default: $newString .= $token;