From 98a211b5572d5e05d7a9cd0a893e03bdbfbf5b25 Mon Sep 17 00:00:00 2001 From: PeratX Date: Sat, 26 Mar 2022 12:34:04 +0800 Subject: [PATCH] loader: add env varible to disable ansi. close #69 --- README.md | 8 ++++++++ src/main/java/org/itxtech/mcl/Loader.java | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 27642ce..eb738ed 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,14 @@ $ chmod +x mcl $ ./mcl ``` +### 禁用控制台颜色 + +配置`mcl.disable-ansi`环境变量为`true`。 + +```bash +$ java "-Dmcl.disable-ansi=true" -jar mcl.jar +``` + ## `Mirai Repo` 列表 * [iTXTech](https://repo.itxtech.org) - **默认** - Cloudflare Pages diff --git a/src/main/java/org/itxtech/mcl/Loader.java b/src/main/java/org/itxtech/mcl/Loader.java index 261de44..dd068ba 100644 --- a/src/main/java/org/itxtech/mcl/Loader.java +++ b/src/main/java/org/itxtech/mcl/Loader.java @@ -64,7 +64,9 @@ public static void main(String[] args) { var loader = new Loader(); try { loader.loadConfig(); - loader.detectLogger(); + if (!"true".equals(System.getProperties().getProperty("mcl.disable-ansi"))) { + loader.detectLogger(); + } loader.start(args); } catch (Exception e) { loader.logger.logException(e);