1. tbrugz
  2. kmlutils

Commits

tbrugz  committed 34e8d09

refactoring & more logging

  • Participants
  • Parent commits f775a10
  • Branches default

Comments (0)

Files changed (3)

File build.xml

View file
-<project name="kmlutils" default="build">
+<project name="kmlutils" default="dist">
 
 	<!--
 	for debugging:
 		<javac srcdir="src" destdir="bin" classpath="lib/*" debug="on" />
 	</target>
 
-	<target name="build" depends="prepare, compile">
+	<target name="dist" depends="prepare, compile">
 		<mkdir dir="dist"/>
 		<jar destfile="dist/svg2kml.jar" basedir="bin"/>
 		<copy tofile="dist/kmlutils.jar" file="dist/svg2kml.jar"/>

File src/tbrugz/graphml/DumpGraphMLModel.java

View file
 package tbrugz.graphml;
 
+import java.io.File;
 import java.io.PrintStream;
 import java.util.Set;
 import java.util.TreeSet;
 
 public class DumpGraphMLModel extends AbstractDump {
 
-	static Log log = LogFactory.getLog(AbstractDump.class);
+	static Log log = LogFactory.getLog(DumpGraphMLModel.class);
+	
+	static final String DEFAULT_SNIPPETS_FILE = "graphml-snippets.properties";
 
 	Set<String> nodeNames = new TreeSet<String>();
 	
 	{
-		loadSnippets("graphml-snippets.properties");
+		loadSnippets(DEFAULT_SNIPPETS_FILE);
+		log.debug("loading default snippets file: "+new File(DEFAULT_SNIPPETS_FILE).getAbsolutePath());
 	}
 	
 	@Override

File src/tbrugz/xml/AbstractDump.java

View file
 	public void loadProp(Properties prop, String fileName) {
 		try {
 			prop.load(new FileInputStream(fileName));
+			log.info("loaded prop file: "+fileName);
 		}
 		catch(IOException ioe) {
 			try {
 				prop.load(AbstractDump.class.getResourceAsStream("/"+fileName));
+				log.info("loaded prop resource: "+fileName);
 			}
 			catch(IOException e) {
-				log.warn("Error loading file: "+ioe);
+				log.warn("error loading file: "+ioe);
 			}
 		} 
 	}