From fe578229bf7e77b522eda8737374c2f26b30c24b Mon Sep 17 00:00:00 2001 From: Luck Date: Mon, 1 Nov 2021 20:45:46 +0000 Subject: async-profiler on macos --- .../main/java/me/lucko/spark/nukkit/NukkitSparkPlugin.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'spark-nukkit/src/main/java') diff --git a/spark-nukkit/src/main/java/me/lucko/spark/nukkit/NukkitSparkPlugin.java b/spark-nukkit/src/main/java/me/lucko/spark/nukkit/NukkitSparkPlugin.java index b2db9f7..c9e099d 100644 --- a/spark-nukkit/src/main/java/me/lucko/spark/nukkit/NukkitSparkPlugin.java +++ b/spark-nukkit/src/main/java/me/lucko/spark/nukkit/NukkitSparkPlugin.java @@ -33,6 +33,7 @@ import cn.nukkit.plugin.service.ServicePriority; import cn.nukkit.scheduler.AsyncTask; import java.nio.file.Path; +import java.util.logging.Level; import java.util.stream.Stream; public class NukkitSparkPlugin extends PluginBase implements SparkPlugin { @@ -88,6 +89,19 @@ public class NukkitSparkPlugin extends PluginBase implements SparkPlugin { }); } + @Override + public void log(Level level, String msg) { + if (level == Level.INFO) { + getLogger().info(msg); + } else if (level == Level.WARNING) { + getLogger().warning(msg); + } else if (level == Level.SEVERE) { + getLogger().error(msg); + } else { + throw new IllegalArgumentException(level.getName()); + } + } + @Override public ClassSourceLookup createClassSourceLookup() { return new NukkitClassSourceLookup(); -- cgit