-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
11 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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())); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters