Because other classes in this project need a default place to send
their messages, the Msg class is a wrapper to give the other
classes a single place to send messages. Methods in this class are
static, so it doesn't have to be instantiated. This class can be
sliced, diced, extended, and mangled to support things like J2EE,
Jython, plain Java, and so on. The point is to factor out all the
message code in the project to this class, in order to have a
central place that collects and emits messages. The place a message
goes when it is emitted is called a "sink" in this class.
Convenience function to set the sink to System.out. Sometimes
that's all you want, especially in command line mode.
public static void talkToOutputStream(java.io.OutputStream myos)
Users can set the output to their own stream. Note that this
method sets the master output sink to a stream, which could be
a file but usually isn't. Note that even if this is redirected
to a file, it's not the same file that talkToFile and
stopTalkingToFile use. This is intentional, so messages can be
sent to both an output stream and a file.
myos - The output stream the user wants us to write to.
public static void stopTalkingToFile()
Turns off writing messages to a file. We do it this way to be
able to turn on writing to a file at certain points, and then
turn it off while still seeing all messages appear on the
public static void talkToFile(java.lang.String newfile)
This method begins writing messages to a named file. (If the
file doesn't have a name, you probably want
newfile - The file name of the file to talk to.
public static void beQuiet(boolean myquiet)
We can produce less output if asked to be quiet. This is a
toggle, so if we're quiet we can go back to outputting
myquiet - True to be more quiet, otherwise false.
public static void say(java.lang.String what)
Method to print a line. I tried to make this short, so the
two-digit year is used. Note this is synchronized, because this
method could be called from multiple threads. (In fact, you
normally want that behavior so you can see the threads running