Jalog 1.3
java.lang.Object io.github.JalogTeam.jalog.Jalog.Output io.github.JalogTeam.jalog.Jalog.OutputErr
public static class Jalog.OutputErr
Jalog uses OutputErr
to write error messages.
OutputErr
may be redirected to a
nonstandard destination or captured for
use by the calling program.
In order to write to a nonstandard destination, two things are needed. First,
a new class is derived from Jalog.OutputErr
. The function
print
must be overridden so that output is directed to the
intended destination. For example, the following
declaration
writes to System.Out with decorations:
public static class TestErr extends Jalog.OutputErr { public void print(String s) { System.out.print("#" + s); } }
Secondly, an instance of the new class is introduced to Jalog with
setErr
before any Jalog code is called. For example,
continuing the above example, the following instructions can be used:
Jalog myJalog = new Jalog(); myJalog.setErr(new TestErr());
Instead of Jalog.OutputErr
the parent class
Jalog.Output
can be used.
Method Summary | |
---|---|
void
|
print(String s)
NOTE: For internal use of the Jalog system. Not to be called by a application program. This is provided to redirect output. Writes error messages to desired destination. |
Method Detail |
---|
public void print(String s)
s
- the string to be written.