MainLogger: Require useFormattingCodes as a constructor parameter

this avoids needing to call Terminal::init() before starting a MainLogger. Since it inits the formatting codes anyway when log messages are first recorded, it shouldn't be necessary to pre-initialize it.
This commit is contained in:
Dylan K. Taylor
2021-02-04 19:16:22 +00:00
parent 6d64fb9af8
commit 709b4154d7
3 changed files with 6 additions and 8 deletions

View File

@ -42,9 +42,8 @@ class AsyncPoolTest extends TestCase{
private $mainLogger;
public function setUp() : void{
Terminal::init();
@define('pocketmine\\COMPOSER_AUTOLOADER_PATH', dirname(__DIR__, 3) . '/vendor/autoload.php');
$this->mainLogger = new MainLogger(tempnam(sys_get_temp_dir(), "pmlog"));
$this->mainLogger = new MainLogger(tempnam(sys_get_temp_dir(), "pmlog"), false);
$this->pool = new AsyncPool(2, 1024, new \BaseClassLoader(), $this->mainLogger, new SleeperHandler());
}