MainLogger: accept timezone as a constructor parameter

this makes it easier to unit-test, as well as making it independent of Timezone.
This commit is contained in:
Dylan K. Taylor
2021-02-04 21:50:06 +00:00
parent 54d9342ed9
commit 169650dc5b
3 changed files with 4 additions and 4 deletions

View File

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