diff --git a/src/org/helioviewer/jhv/base/logging/Log.java b/src/org/helioviewer/jhv/base/logging/Log.java index 93e2efa..0933558 100644 --- a/src/org/helioviewer/jhv/base/logging/Log.java +++ b/src/org/helioviewer/jhv/base/logging/Log.java @@ -1,21 +1,27 @@ package org.helioviewer.jhv.base.logging; +import org.helioviewer.jhv.base.time.TimeUtils; + public class Log { + private static String format(String s) { + return TimeUtils.format(System.currentTimeMillis()) + " [" + Thread.currentThread().getName() + "] " + s; + } + public static void warn(Object obj) { - System.err.println(obj.toString()); + System.err.println(format("WARN " + obj.toString())); } public static void error(Object obj) { - System.err.println(obj.toString()); + System.err.println(format("ERROR " + obj.toString())); } public static void error(Object obj, Throwable error) { - System.err.println(obj.toString() + error.toString()); + System.err.println(format("ERROR " + obj.toString() + error.toString())); } public static void debug(Object obj) { - System.out.println(obj.toString()); + System.out.println(format("DEBUG " + obj.toString())); } } diff --git a/src/org/helioviewer/jhv/io/DataSourcesTask.java b/src/org/helioviewer/jhv/io/DataSourcesTask.java index 6475375..3f36577 100644 --- a/src/org/helioviewer/jhv/io/DataSourcesTask.java +++ b/src/org/helioviewer/jhv/io/DataSourcesTask.java @@ -33,7 +33,7 @@ public void run() { JSONObject json = JSONUtils.getJSONStream(new DownloadStream(url).getInput()); schema.validate(json); } catch (Exception e) { - Log.error(e); + Log.error(url + " : " + e); } }