summaryrefslogtreecommitdiff
path: root/src/main/java/bjc
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/bjc')
-rw-r--r--src/main/java/bjc/everge/Everge.java16
-rw-r--r--src/main/java/bjc/everge/LogStream.java29
2 files changed, 44 insertions, 1 deletions
diff --git a/src/main/java/bjc/everge/Everge.java b/src/main/java/bjc/everge/Everge.java
index a3f66b6..f061200 100644
--- a/src/main/java/bjc/everge/Everge.java
+++ b/src/main/java/bjc/everge/Everge.java
@@ -68,18 +68,34 @@ public class Everge {
*/
private LogStream errStream = new LogStream(System.err);
+ /**
+ * Set the output stream.
+ * @param out The output stream..
+ */
public void setOutput(PrintStream out) {
outStream = out;
}
+ /**
+ * Set the output stream.
+ * @param out The output stream..
+ */
public void setOutput(OutputStream out) {
outStream = new PrintStream(out);
}
+ /**
+ * Set the error stream.
+ * @param err The error stream.
+ */
public void setError(PrintStream err) {
errStream = new LogStream(err);
}
+ /**
+ * Set the error stream.
+ * @param err The error stream.
+ */
public void setError(OutputStream err) {
errStream = new LogStream(new PrintStream(err));
}
diff --git a/src/main/java/bjc/everge/LogStream.java b/src/main/java/bjc/everge/LogStream.java
index 9bc5a43..f4dd217 100644
--- a/src/main/java/bjc/everge/LogStream.java
+++ b/src/main/java/bjc/everge/LogStream.java
@@ -73,26 +73,48 @@ public class LogStream {
verbosity = level;
}
+ /**
+ * Get the verbosity of the stream.
+ * @return The verbosity of the stream.
+ */
public int verbosity() {
return verbosity;
}
+ /**
+ * Set the verbosity of the stream.
+ * @param verb The verbosity of the stream.
+ */
public void verbosity(int verb) {
verbosity = verb;
}
+ /**
+ * Increment the verbosity of the stream.
+ */
public void louder() {
louder(1);
}
+ /**
+ * Increase the verbosity of the stream by an amount.
+ * @param amt The amount to increase the verbosity by.
+ */
public void louder(int amt) {
verbosity += amt;
}
-
+
+ /**
+ * Decrement the verbosity of the stream.
+ */
public void quieter() {
quieter(1);
}
+ /**
+ * Decrease the verbosity of the stream by an amount.
+ * @param amt The amount to decrease the verbosity by.
+ */
public void quieter(int amt) {
verbosity -= amt;
}
@@ -120,6 +142,11 @@ public class LogStream {
output.printf(msg, args);
}
+ /**
+ * Print a message at a given verbosity level.
+ * @param lvl The verbosity level.
+ * @param msg The message to print.
+ */
public void message(int lvl, String msg) {
if (verbosity >= lvl) {
output.print(msg);