aboutsummaryrefslogtreecommitdiff
path: root/spark-waterdog/src/main/java/me/lucko/spark/waterdog
diff options
context:
space:
mode:
authorLuck <git@lucko.me>2021-11-01 20:45:46 +0000
committerLuck <git@lucko.me>2021-11-01 20:46:16 +0000
commitfe578229bf7e77b522eda8737374c2f26b30c24b (patch)
tree467b78fbbccb801788194f6a6e586963458f41d8 /spark-waterdog/src/main/java/me/lucko/spark/waterdog
parent8ebf2d39a1d95c409d2151374b8ff1ad9e776d97 (diff)
downloadspark-fe578229bf7e77b522eda8737374c2f26b30c24b.tar.gz
spark-fe578229bf7e77b522eda8737374c2f26b30c24b.tar.bz2
spark-fe578229bf7e77b522eda8737374c2f26b30c24b.zip
async-profiler on macos
Diffstat (limited to 'spark-waterdog/src/main/java/me/lucko/spark/waterdog')
-rw-r--r--spark-waterdog/src/main/java/me/lucko/spark/waterdog/WaterdogSparkPlugin.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/spark-waterdog/src/main/java/me/lucko/spark/waterdog/WaterdogSparkPlugin.java b/spark-waterdog/src/main/java/me/lucko/spark/waterdog/WaterdogSparkPlugin.java
index 8c90ea8..fd2f031 100644
--- a/spark-waterdog/src/main/java/me/lucko/spark/waterdog/WaterdogSparkPlugin.java
+++ b/spark-waterdog/src/main/java/me/lucko/spark/waterdog/WaterdogSparkPlugin.java
@@ -31,6 +31,7 @@ import dev.waterdog.waterdogpe.command.CommandSender;
import dev.waterdog.waterdogpe.plugin.Plugin;
import java.nio.file.Path;
+import java.util.logging.Level;
import java.util.stream.Stream;
public class WaterdogSparkPlugin extends Plugin implements SparkPlugin {
@@ -81,6 +82,19 @@ public class WaterdogSparkPlugin extends Plugin 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 WaterdogClassSourceLookup(getProxy());
}