Builds and runs.

This commit is contained in:
toxuin
2017-11-13 17:32:30 +03:00
committed by Haarolean
parent f034cef465
commit 396351771c
7 changed files with 53 additions and 18 deletions

View File

@@ -22,24 +22,19 @@ public class PluginSlf4jFactory implements ILoggerFactory {
private String name;
private boolean isEnabled(Level level) {
if (SshdPlugin.instance != null) {
return SshdPlugin.instance.getLogger().isLoggable(level);
}
return false;
return SshdPlugin.instance != null && SshdPlugin.instance.getLogger().isLoggable(level);
}
private void log(Level level, String s, Object[] objects) {
if (SshdPlugin.instance != null && isEnabled(level)) {
FormattingTuple ft = MessageFormatter.arrayFormat(s, objects);
SshdPlugin.instance.getLogger().log(level, ft.getMessage(), ft.getThrowable());
SshdPlugin.instance.getLogger().log(level, s, Thread.currentThread().getStackTrace());
}
}
private void log(Level level, String s, Throwable throwable) {
if (SshdPlugin.instance != null && isEnabled(level)) {
SshdPlugin.instance.getLogger().log(level, s, throwable);
SshdPlugin.instance.getLogger().log(level, s, Thread.currentThread().getStackTrace());
}
}