public class Logger
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
boolean |
active
To disable and enable logger
|
Modifier and Type | Method and Description |
---|---|
void |
addMessage(Message m)
Adds a message to the messages list
|
void |
flushMessages()
Empties the messages list of all messages
|
static Logger |
getInstance()
Returns the instance of the singleton Logger
|
int |
getMessageCount()
Get the number of error and warning messages combined
|
int |
getMessageCount(int type)
Get either error or warning messages
|
java.util.ArrayList<Message> |
getMessages()
Returns the list of errors and warnings
|
java.util.ArrayList<Message> |
getMessages(int type)
Returns the list of errors and warnings
|
void |
printMessages()
Sends all messages to the console in one batch Flushes the message log
after this is done to prepare for a new game
|
public static Logger getInstance()
public java.util.ArrayList<Message> getMessages()
public java.util.ArrayList<Message> getMessages(int type)
public void printMessages()
public int getMessageCount()
public int getMessageCount(int type)
type
- 0 warnings, 1 errorspublic void addMessage(Message m)
m
- the message to be added to messagespublic void flushMessages()