PageRenderTime 3233ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/src/main/java/org/dynmap/Log.java

http://github.com/webbukkit/dynmap
Java | 32 lines | 30 code | 2 blank | 0 comment | 1 complexity | 6dd583b71e80510ed4dfb14d4ca48ea4 MD5 | raw file
Possible License(s): Apache-2.0
  1. package org.dynmap;
  2. import java.util.logging.Level;
  3. import java.util.logging.Logger;
  4. public class Log {
  5. protected static final Logger log = Logger.getLogger("Minecraft");
  6. protected static final String LOG_PREFIX = "[dynmap] ";
  7. public static boolean verbose = false;
  8. public static void info(String msg) {
  9. log.log(Level.INFO, LOG_PREFIX + msg);
  10. }
  11. public static void verboseinfo(String msg) {
  12. if(verbose)
  13. log.log(Level.INFO, LOG_PREFIX + msg);
  14. }
  15. public static void severe(Exception e) {
  16. log.log(Level.SEVERE, LOG_PREFIX + "Exception occured: ", e);
  17. }
  18. public static void severe(String msg) {
  19. log.log(Level.SEVERE, LOG_PREFIX + msg);
  20. }
  21. public static void severe(String msg, Exception e) {
  22. log.log(Level.SEVERE, LOG_PREFIX + msg, e);
  23. }
  24. public static void warning(String msg) {
  25. log.log(Level.WARNING, LOG_PREFIX + msg);
  26. }
  27. public static void warning(String msg, Exception e) {
  28. log.log(Level.WARNING, LOG_PREFIX + msg, e);
  29. }
  30. }