public interface MsgLogger
Messages are short strings (a couple of lines) that indicate some state of the program, and that have a severity code associated with them (see below). Simple strings is text (can be long) that has no severity code associated with it. Typical use of simple strings is to display help texts.
Each message has a severity code, which can be one of the following: LOG, INFO, WARNING, ERROR. Each implementation should treat each severity code in a way which corresponds to the type of diplay used.
Messages are printed via the 'printmsg()' method. Simple strings are printed via the 'print()', 'println()' and 'flush()' methods, each simple string is considered to be terminated once the 'flush()' method has been called. The 'printmsg()' method should never be called before a previous simple string has been terminated.
Modifier and Type | Field and Description |
---|---|
static int |
ERROR
Severity of message.
|
static int |
INFO
Severity of message.
|
static int |
LOG
Severity of message.
|
static int |
WARNING
Severity of message.
|
Modifier and Type | Method and Description |
---|---|
void |
flush()
Writes any buffered data from the println() method to the device.
|
void |
println(String str,
int flind,
int ind)
Prints the string 'str' to the output device, appending a line
return.
|
void |
printmsg(int sev,
String msg)
Prints the message 'msg' to the output device, appending a newline,
with severity 'sev'.
|
static final int LOG
static final int INFO
static final int WARNING
static final int ERROR
void printmsg(int sev, String msg)
sev
- The message severity (LOG, INFO, etc.)msg
- The message to displayvoid println(String str, int flind, int ind)
str
- The string to printflind
- Indentation of the first lineind
- Indentation of any other lines.void flush()
Copyright © 2014. All rights reserved.