Index: src/uk/me/parabola/mkgmap/CommandArgs.java
===================================================================
--- src/uk/me/parabola/mkgmap/CommandArgs.java	(revision 4652)
+++ src/uk/me/parabola/mkgmap/CommandArgs.java	(working copy)
@@ -11,6 +11,7 @@
 
 import uk.me.parabola.imgfmt.ExitException;
 import uk.me.parabola.imgfmt.app.srt.Sort;
+import uk.me.parabola.log.Logger;
 import uk.me.parabola.util.EnhancedProperties;
 
 public class CommandArgs {
@@ -97,14 +98,14 @@
 		// Test if directory exists
 		File outputDir = new File(fileOutputDir);
 		if (!outputDir.exists()) {
-			System.out.println("Output directory not found. Creating directory '" + fileOutputDir + "'");
+			Logger.defaultLogger.warn("Output directory not found. Creating directory '" + fileOutputDir + "'");
 			outputDir.mkdirs();
 			if (!outputDir.exists()) {
-				System.err.println("Unable to create output directory! Using default directory instead");
+				Logger.defaultLogger.warn("Unable to create output directory! Using default directory instead");
 				fileOutputDir = DEFAULT_DIR;
 			}
 		} else if (!outputDir.isDirectory()) {
-			System.err.println("The --output-dir parameter must specify a directory. The parameter is being ignored, writing to default directory instead.");
+			Logger.defaultLogger.warn("The --output-dir parameter must specify a directory. The parameter is being ignored, writing to default directory instead.");
 			fileOutputDir = DEFAULT_DIR;
 		}
 		
Index: src/uk/me/parabola/mkgmap/osmstyle/eval/AbstractOp.java
===================================================================
--- src/uk/me/parabola/mkgmap/osmstyle/eval/AbstractOp.java	(revision 4652)
+++ src/uk/me/parabola/mkgmap/osmstyle/eval/AbstractOp.java	(working copy)
@@ -20,6 +20,7 @@
 import java.util.Set;
 
 import uk.me.parabola.imgfmt.ExitException;
+import uk.me.parabola.log.Logger;
 import uk.me.parabola.mkgmap.osmstyle.function.GetTagFunction;
 import uk.me.parabola.mkgmap.reader.osm.Element;
 import uk.me.parabola.mkgmap.scan.SyntaxException;
@@ -210,7 +211,7 @@
 		} else if (this.isType(NodeType.EXISTS) || this.isType(NodeType.NOT_EXISTS) || this.isType(NodeType.NOT)) {
 			set.addAll(getFirst().getEvaluatedTagKeys());
 		} else if (this.getFirst() != null) {
-			System.err.println("Unhandled type of Op");
+			Logger.defaultLogger.error("Unhandled type of Op");
 		}
 			
 	}
Index: src/uk/me/parabola/mkgmap/osmstyle/housenumber/HousenumberGenerator.java
===================================================================
--- src/uk/me/parabola/mkgmap/osmstyle/housenumber/HousenumberGenerator.java	(revision 4652)
+++ src/uk/me/parabola/mkgmap/osmstyle/housenumber/HousenumberGenerator.java	(working copy)
@@ -106,7 +106,7 @@
 		if (n != nameSearchDepth) {
 			nameSearchDepth = Math.min(25, Math.max(0, n));
 			if (nameSearchDepth != n) {
-				System.err.println("name-service-roads=" + n + " was changed to name-service-roads=" + nameSearchDepth);
+				Logger.defaultLogger.warn("name-service-roads=" + n + " was changed to name-service-roads=" + nameSearchDepth);
 			}
 		}
 	}
Index: src/uk/me/parabola/mkgmap/osmstyle/StyleImpl.java
===================================================================
--- src/uk/me/parabola/mkgmap/osmstyle/StyleImpl.java	(revision 4652)
+++ src/uk/me/parabola/mkgmap/osmstyle/StyleImpl.java	(working copy)
@@ -239,19 +239,18 @@
 		try (InputStream is = this.getClass().getResourceAsStream("/styles/builtin-tag-list");) {
 			if (is != null) {
 				BufferedReader br = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8));
-				// System.out.println("Got built in list");
 				String line;
 				while ((line = br.readLine()) != null) {
 					line = line.trim();
 					if (line.startsWith("#"))
 						continue;
-					// System.out.println("adding " + line);
+
 					set.add(line);
 				}
 			}
 		} catch (IOException e) {
 			// the file doesn't exist, this is ok but unlikely
-			System.err.println("warning: built in tag list not found");
+			Logger.defaultLogger.warn("built in tag list not found");
 		}
 		return set;
 	}
@@ -262,7 +261,7 @@
 			l = LevelInfo.DEFAULT_LEVELS;
 		LevelInfo[] levels = LevelInfo.createFromString(l);
 		if (performChecks && levels[0].getBits() <= 10) {
-			System.err.println("Warning: Resolution values <= 10 may confuse MapSource: " + l);
+			Logger.defaultLogger.warn("Resolution values <= 10 may confuse MapSource: " + l);
 		}
 		l = generalOptions.get("overview-levels");
 		if (l != null){
@@ -270,10 +269,10 @@
 			// TODO: make sure that the combination of the two level strings makes sense
 			if (performChecks){
 				if (ovLevels[0].getBits() <= 10){
-					System.err.println("Warning: Resolution values <= 10 may confuse MapSource: " + l);
+					Logger.defaultLogger.warn("Resolution values <= 10 may confuse MapSource: " + l);
 				}
 				if (levels[0].getLevel() >= ovLevels[ovLevels.length-1].getLevel()){
-					System.err.println("Warning: Overview level not higher than highest normal level. " + l);
+					Logger.defaultLogger.warn("Overview level not higher than highest normal level. " + l);
 				}
 			}
 			List<LevelInfo> tmp = new ArrayList<>();
@@ -336,7 +335,7 @@
 				String val = opt.getValue();
 				if ("name-tag-list".equals(key)) {
 					if (!"name".equals(val)) {
-						System.err.println("Warning: option name-tag-list used in the style options is ignored. "
+						Logger.defaultLogger.warn("Option name-tag-list used in the style options is ignored. "
 								+ "Please use only the command line option to specify this value.");
 					}
 				} else if (OPTION_LIST.contains(key)) {
@@ -410,7 +409,7 @@
 		try {
 			baseStyles.add(new StyleImpl(location, name, props, performChecks));
 		} catch (SyntaxException e) {
-			System.err.println("Error in style: " + e.getMessage());
+			Logger.defaultLogger.error("Error in style: " + e.getMessage());
 		} catch (FileNotFoundException e) {
 			// not found, try on the classpath.  This is the common
 			// case where you have an external style, but want to
@@ -420,9 +419,9 @@
 			try {
 				baseStyles.add(new StyleImpl(null, name, props, performChecks));
 			} catch (SyntaxException se) {
-				System.err.println("Error in style: " + se.getMessage());
+				Logger.defaultLogger.error("Error in style: " + se.getMessage());
 			} catch (FileNotFoundException e1) {
-				log.error("Could not find base style", e);
+				Logger.defaultLogger.error("Could not find base style", e);
 			}
 		}
 	}
@@ -478,7 +477,7 @@
 		}
 
 		if (version > VERSION) {
-			System.err.println("Warning: unrecognised style version " + version +
+			Logger.defaultLogger.warn("Unrecognised style version " + version +
 			", but only versions up to " + VERSION + " are understood");
 		}
 	}
@@ -546,7 +545,7 @@
 		try {
 			style = new StyleImpl(loc, name, props, WITHOUT_CHECKS);
 		} catch (SyntaxException e) {
-			System.err.println("Error in style: " + e.getMessage());
+			Logger.defaultLogger.error("Error in style: " + e.getMessage());
 			throw new ExitException("Could not open style " + (name == null? "":name));
 		} catch (FileNotFoundException e) {
 			String msg = "Could not open style ";
Index: src/uk/me/parabola/mkgmap/reader/hgt/HGTList.java
===================================================================
--- src/uk/me/parabola/mkgmap/reader/hgt/HGTList.java	(revision 4652)
+++ src/uk/me/parabola/mkgmap/reader/hgt/HGTList.java	(working copy)
@@ -38,7 +38,7 @@
 		try {
 			knownHgt = loadConfig();
 		} catch (IOException e) {
-			e.printStackTrace();
+			Logger.defaultLogger.error("Error reading hgt config", e);
 		}
 	} 
 	
@@ -114,7 +114,7 @@
 					
 					bs.set(getBitSetPos(lat, lon));
 				} catch (NumberFormatException e) {
-					e.printStackTrace();
+					Logger.defaultLogger.error("Error reading latitude/longitude", e);
 				}
 			}
 			return bs;
Index: src/uk/me/parabola/mkgmap/reader/hgt/HGTReader.java
===================================================================
--- src/uk/me/parabola/mkgmap/reader/hgt/HGTReader.java	(revision 4652)
+++ src/uk/me/parabola/mkgmap/reader/hgt/HGTReader.java	(working copy)
@@ -130,7 +130,7 @@
 				HGTList hgtList = HGTList.get();
 				if (hgtList != null) {
 					if (hgtList.shouldExist(lat, lon))
-						System.err.println(this.getClass().getSimpleName() + ": file " + fileName + " not found but it should exist. Height values will be 0.");
+						Logger.defaultLogger.warn(this.getClass().getSimpleName() + ": file " + fileName + " not found but it should exist. Height values will be 0.");
 				} else { 
 					log.warn("file " + fileName + " not found. Is expected to cover sea.");
 				}
Index: src/uk/me/parabola/mkgmap/reader/osm/CoastlineFileLoader.java
===================================================================
--- src/uk/me/parabola/mkgmap/reader/osm/CoastlineFileLoader.java	(revision 4652)
+++ src/uk/me/parabola/mkgmap/reader/osm/CoastlineFileLoader.java	(working copy)
@@ -106,8 +106,7 @@
 			} catch (FileNotFoundException exp) {
 				log.error("Coastline file " + coastlineFile + " not found.");
 			} catch (Exception exp) {
-				log.error(exp);
-				exp.printStackTrace();
+				log.error("Unexpected exception reading " + coastlineFile, exp);
 			}
 		}
 		coastlinesLoaded.set(true);
Index: src/uk/me/parabola/mkgmap/reader/osm/OsmMapDataSource.java
===================================================================
--- src/uk/me/parabola/mkgmap/reader/osm/OsmMapDataSource.java	(revision 4652)
+++ src/uk/me/parabola/mkgmap/reader/osm/OsmMapDataSource.java	(working copy)
@@ -167,7 +167,7 @@
 					break;
 				} catch (InstantiationException | IllegalAccessException e) {
 					// TODO Auto-generated catch block
-					e.printStackTrace();
+					log.error("Unexpected error", e);
 				}
 			}
 		}
Index: src/uk/me/parabola/mkgmap/reader/osm/xml/OsmXmlHandler.java
===================================================================
--- src/uk/me/parabola/mkgmap/reader/osm/xml/OsmXmlHandler.java	(revision 4652)
+++ src/uk/me/parabola/mkgmap/reader/osm/xml/OsmXmlHandler.java	(working copy)
@@ -221,7 +221,7 @@
 		 */
 		@Override
 		public void fatalError(SAXParseException e) throws SAXException {
-			System.err.println("Error at line " + e.getLineNumber() + ", col "
+			Logger.defaultLogger.error("Error at line " + e.getLineNumber() + ", col "
 					+ e.getColumnNumber());
 			super.fatalError(e);
 		}
Index: src/uk/me/parabola/mkgmap/reader/polish/RestrictionHelper.java
===================================================================
--- src/uk/me/parabola/mkgmap/reader/polish/RestrictionHelper.java	(revision 4652)
+++ src/uk/me/parabola/mkgmap/reader/polish/RestrictionHelper.java	(working copy)
@@ -14,6 +14,7 @@
 
 import uk.me.parabola.imgfmt.app.CoordNode;
 import uk.me.parabola.imgfmt.app.net.GeneralRouteRestriction;
+import uk.me.parabola.log.Logger;
 import uk.me.parabola.mkgmap.general.MapDetails;
 
 import java.util.ArrayList;
@@ -56,7 +57,7 @@
     	if (restriction.isValid())
     		allRestrictions.add(restriction);
     	else {
-    		System.err.println(restriction);
+    		Logger.defaultLogger.warn("Invalid restriction " + restriction.toString());
     	}
     }
 }
