Skip to content

Instantly share code, notes, and snippets.

@huskercane
Created July 29, 2014 15:26
Show Gist options
  • Select an option

  • Save huskercane/f7af3b3829aa9ea11d20 to your computer and use it in GitHub Desktop.

Select an option

Save huskercane/f7af3b3829aa9ea11d20 to your computer and use it in GitHub Desktop.
Logger for jsch
class JschLogger implements com.jcraft.jsch.Logger{
private static Class CLASS_NAME = JschLogger.class;
@Override
public boolean isEnabled(int level) {
return true;
}
@Override
public void log(int level, String message) {
switch (level) {
case com.jcraft.jsch.Logger.DEBUG:
System.out.println(CLASS_NAME + message);
break;
case com.jcraft.jsch.Logger.INFO:
System.out.println(CLASS_NAME + message);
break;
case com.jcraft.jsch.Logger.WARN:
System.out.println(CLASS_NAME+ message);
break;
case com.jcraft.jsch.Logger.ERROR:
System.out.println(CLASS_NAME+ message);
break;
case com.jcraft.jsch.Logger.FATAL:
System.out.println(CLASS_NAME+ message);
break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment