1 package org.ozoneDB.tools.OPP.message; 9 10 import org.ozoneDB.tools.OPP.message.MessageWriter; 11 12 public class StdOutMessageWriter implements MessageWriter { 13 private boolean quiet; 14 private boolean debug; 15 16 public boolean isQuiet() { 17 return quiet; 18 } 19 20 public void setQuiet(boolean quiet) { 21 this.quiet = quiet; 22 } 23 24 public boolean isDebug() { 25 return debug; 26 } 27 28 public void setDebug(boolean debug) { 29 this.debug = debug; 30 } 31 32 public StdOutMessageWriter(boolean quiet, boolean debug) { 33 this.quiet = quiet; 34 this.debug = debug; 35 } 36 37 public void startGeneration(String object) { 38 } 40 41 public void error(String message) { 42 System.out.println("ERROR: " + message); 43 } 44 45 public void warning(String message) { 46 System.out.println("WARNING: " + message); 47 System.out.println(); 48 } 49 50 public void warning(String filename, int row, String message) { 51 System.out.println("WARNING processing file " + filename + " at line " + row + "!"); 52 System.out.println("WARNING: " + message); 53 System.out.println(); 54 } 55 56 public void info(String message) { 57 if (!quiet) { 58 System.out.println(message); 59 } 60 } 61 62 public void debug(String message) { 63 if (debug) { 64 System.out.println(message); 65 } 66 } 67 68 public void endGeneration() { 69 } 71 } 72 | Popular Tags |