Skip to content

Commit

Permalink
add void logger
Browse files Browse the repository at this point in the history
  • Loading branch information
Pikachu920 committed May 13, 2018
1 parent 1bf8b8d commit fc2d13d
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,13 @@ public void load() {
@Override
public void unregister(Trigger t) {
// workaround for spark npe
server.get("workaroundForSparkNpe" + UUID.randomUUID().toString(), (req, resp) -> "you shouldn't be seeing this");
server.options("workaroundForSparkNpe" + UUID.randomUUID().toString(), (req, resp) -> "you shouldn't be seeing this");
server.stop();
}

@Override
public void unregisterAll() {
unregister(null);
}

@Override
Expand Down
82 changes: 82 additions & 0 deletions src/main/java/com/pikachu/webaddon/util/VoidLogger.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
package com.pikachu.webaddon.util;


import org.eclipse.jetty.util.log.Logger;

public class VoidLogger implements Logger {

@Override
public String getName() {
return "VoidLogger";
}

@Override
public void warn(String msg, Object... args) {

}

@Override
public void warn(Throwable thrown) {

}

@Override
public void warn(String msg, Throwable thrown) {

}

@Override
public void info(String msg, Object... args) {

}

@Override
public void info(Throwable thrown) {

}

@Override
public void info(String msg, Throwable thrown) {

}

@Override
public boolean isDebugEnabled() {
return false;
}

@Override
public void setDebugEnabled(boolean enabled) {

}

@Override
public void debug(String msg, Object... args) {

}

@Override
public void debug(String msg, long value) {

}

@Override
public void debug(Throwable thrown) {

}

@Override
public void debug(String msg, Throwable thrown) {

}

@Override
public Logger getLogger(String name) {
return new VoidLogger();
}

@Override
public void ignore(Throwable ignored) {

}
}

0 comments on commit fc2d13d

Please sign in to comment.