diff --git a/mirai-api/src/main/java/net/mamoe/mirai/MiraiAPI.java b/mirai-api/src/main/java/net/mamoe/mirai/MiraiAPI.java index add6345c5..b074181b7 100644 --- a/mirai-api/src/main/java/net/mamoe/mirai/MiraiAPI.java +++ b/mirai-api/src/main/java/net/mamoe/mirai/MiraiAPI.java @@ -1,5 +1,6 @@ package net.mamoe.mirai; +import java.io.PrintStream; import java.util.ArrayList; import java.util.List; @@ -32,6 +33,10 @@ public class MiraiAPI { MiraiMain.main(args); } + public static void setLogger(PrintStream stream){ + MiraiServer.getInstance().getLogger().setOutPutStream(stream); + } + public static String getMiraiVersion(){ return MiraiServer.MIRAI_VERSION; } diff --git a/mirai-console/src/main/java/net/mamoe/mirai/MiraiConsole.java b/mirai-console/src/main/java/net/mamoe/mirai/MiraiConsole.java index cc91a0203..da94d7f28 100644 --- a/mirai-console/src/main/java/net/mamoe/mirai/MiraiConsole.java +++ b/mirai-console/src/main/java/net/mamoe/mirai/MiraiConsole.java @@ -13,4 +13,7 @@ public class MiraiConsole { } + public void log(Object o){ + System.out.println(o); + } } diff --git a/mirai-console/src/main/java/net/mamoe/mirai/MiraiMain.java b/mirai-console/src/main/java/net/mamoe/mirai/MiraiMain.java index 17a003ab8..052fc1864 100644 --- a/mirai-console/src/main/java/net/mamoe/mirai/MiraiMain.java +++ b/mirai-console/src/main/java/net/mamoe/mirai/MiraiMain.java @@ -3,6 +3,8 @@ package net.mamoe.mirai; import lombok.Getter; +import java.io.PrintStream; + /** * @author NaturalHG */