Commit 74100345 authored by Lubomir Bulej's avatar Lubomir Bulej

Added Logging classes for DiSL server and Shadow VM server.

parent 21d592c7
......@@ -383,9 +383,10 @@
</target>
<target name="compile-shvm" depends="compile-shvm-dispatch">
<target name="compile-shvm" depends="compile-util,compile-shvm-dispatch">
<mkdir dir="${build.shvm}" />
<javac destdir="${build.shvm}" srcdir="${src.shvm}" debug="true">
<classpath refid="util.classpath" />
<classpath refid="asm.classpath" />
</javac>
</target>
......@@ -395,12 +396,15 @@
<local name="shvm.server.class" />
<find-class property="shvm.server.class" dir="${build.shvm}" name="DiSLREServer" />
<jar destfile="${out.lib}/${shvm.lib}" basedir="${build.shvm}">
<jar destfile="${out.lib}/${shvm.lib}">
<manifest>
<attribute name="Class-Path" value="${asm.lib}" />
<attribute name="Main-Class" value="${shvm.server.class}" />
<attribute name="DiSL-Version" value="${disl.version}" />
</manifest>
<fileset dir="${build.util}" />
<fileset dir="${build.shvm}" />
</jar>
</target>
......
package ch.usi.dag.disl.util;
import ch.usi.dag.disl.DiSL;
import ch.usi.dag.util.logging.Logger;
/**
* Utility class to provide logging services tailored to the needs of the
* framework.
*
* @author Lubomir Bulej
*/
public final class Logging {
/**
* Package name of the framework entry class.
*/
private static final String
__OLD_PREFIX__ = DiSL.class.getPackage ().getName ();
/**
* Default prefix for top-level logs.
*/
private static final String
__NEW_PREFIX__ = "disl";
/**
* Register provider property alias with the logging class.
*/
static {
Logger.registerProviderAlias ("disl.logging.provider");
Logger.registerLevelAlias ("disl.logging.level");
}
//
private Logging () {
// pure static class - not to be instantiated
}
//
public static Logger getPackageInstance () {
//
// Determine the package this method was called from and strip common
// prefix to get tighter, more local names.
//
final StackTraceElement caller =
Thread.currentThread ().getStackTrace () [2];
return Logger.getPackageInstance (
caller, __OLD_PREFIX__, __NEW_PREFIX__
);
}
}
package ch.usi.dag.dislreserver.util;
import ch.usi.dag.dislreserver.DiSLREServer;
import ch.usi.dag.util.logging.Logger;
/**
* Utility class to provide logging services tailored to the needs of the
* framework.
*
* @author Lubomir Bulej
*/
public final class Logging {
/**
* Package name of the framework entry class.
*/
private static final String
__OLD_PREFIX__ = DiSLREServer.class.getPackage ().getName ();
/**
* Default prefix for top-level logs.
*/
private static final String
__NEW_PREFIX__ = "dislreserver";
/**
* Register provider property alias with the logging class.
*/
static {
Logger.registerProviderAlias ("shvm.logging.provider");
Logger.registerLevelAlias ("shvm.logging.level");
}
//
private Logging () {
// pure static class - not to be instantiated
}
//
public static Logger getPackageInstance () {
//
// Determine the package this method was called from and strip common
// prefix to get tighter, more local names.
//
final StackTraceElement caller =
Thread.currentThread ().getStackTrace () [2];
return Logger.getPackageInstance (
caller, __OLD_PREFIX__, __NEW_PREFIX__
);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment