Package astra.util
Class Logging
- java.lang.Object
-
- astra.core.Module
-
- astra.util.Logging
-
public class Logging extends Module
This class provides a basic logger for ASTRA.Logging is a key debugging technique. This class exposes the Java Logging API to ASTRA. One log is created per agent (the id of the log is the agents name). and the standard suite of log levels is supported:
- SEVERE
- WARNING
- OFF
- ALL
- FINE
- FINER
- FINEST
- INFO
When using a log level, case does not matter.
- Author:
- Rem Collier
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class astra.core.Module
Module.ACTION, Module.EVENT, Module.FORMULA, Module.SENSOR, Module.SUPPRESS_NOTIFICATIONS, Module.TERM
-
-
Constructor Summary
Constructors Constructor Description Logging()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanfine(String event)Action to record a FINE log event.booleanfiner(String event)Action to record a FINER log event.booleanfinest(String event)Action to record a FINEST log event.booleaninfo(String event)Action to record a INFO log event.booleanlog(String level, String event)Action to record a log entry.voidsetAgent(Agent agent)This is an internal (non-API) method that initialises the logger whose id is set to the agents name.booleansetLevel(String level)Action to set the logging level.booleansevere(String event)Action to record a SEVERE log event.booleanwarning(String event)Action to record a WARNING log event.
-
-
-
Method Detail
-
setAgent
public void setAgent(Agent agent)
This is an internal (non-API) method that initialises the logger whose id is set to the agents name.
-
setLevel
public boolean setLevel(String level)
Action to set the logging level.The logging level is one of: SEVERE, WARNING, OFF, ALL, FINE, FINER, FINEST, INFO
- Parameters:
level- the logging level- Returns:
- true if the action succeeds, false otherwise
-
log
public boolean log(String level, String event)
Action to record a log entry.Basic logging action. Combines the message with a log level
- Parameters:
level- the logging levelevent- the message- Returns:
- true if the action succeeds, false otherwise
-
severe
public boolean severe(String event)
Action to record a SEVERE log event.- Parameters:
event- the event- Returns:
- true if the action succeeds, false otherwise
-
warning
public boolean warning(String event)
Action to record a WARNING log event.- Parameters:
event- the event- Returns:
- true if the action succeeds, false otherwise
-
info
public boolean info(String event)
Action to record a INFO log event.- Parameters:
event- the event- Returns:
- true if the action succeeds, false otherwise
-
fine
public boolean fine(String event)
Action to record a FINE log event.- Parameters:
event- the event- Returns:
- true if the action succeeds, false otherwise
-
finer
public boolean finer(String event)
Action to record a FINER log event.- Parameters:
event- the event- Returns:
- true if the action succeeds, false otherwise
-
finest
public boolean finest(String event)
Action to record a FINEST log event.- Parameters:
event- the event- Returns:
- true if the action succeeds, false otherwise
-
-