|
The only pure Java Subversion library in the world!
|
|
Setting a custom logger (for debug logging)
When you're using SVNKit in your application it is not always an option to let
SVNKit use JDK logging API. Instead you may like to have a fine-grained control over
the way SVNKit logs its operations. The solution is to provide SVNKit with a custom logger
class that should extend the SVNDebugLoggerAdapter class. The code below demonstrates
how it could be done.
...
import org.tmatesoft.svn.util.SVNDebugLog ;
import org.tmatesoft.svn.util.SVNDebugLoggerAdapter ;
...
public static void initSVNKitLogger() {
SVNDebugLog.setLogger(new CustomSVNKitLogger());
}
private static class CustomSVNKitLogger
extends SVNDebugLoggerAdapter {
public void log(String message, byte[] data) {
...
}
public void logInfo(String message) {
...
}
public void logError(String message) {
...
}
public void logInfo(Throwable th) {
...
}
public void logError(Throwable th) {
...
}
}
...
initSVNKitLogger();
...
Note: One have to set up a custom logger before any other calls are made to
SVNKit, otherwise default logging will be used - i.e. DefaultSVNDebugLogger (org.tmatesoft.svn.core.internal.util).
How to obtain its log files read this article.
If you have any questions regarding SVNKit, would like to report a bug or contribute a patch, please write to
support@svnkit.com
|