Several recorders can exist at the same time. Each recorder is associated with a file. The filename is used as a unique identifier for the recorders. The first call to the recorder task with an unused filename will create a recorder (using the parameters provided) and add it to the listeners of the build. All subsequent calls to the recorder task using this filename will modify that recorders state (recording or not) or other properties (like logging level).
Some technical issues: the file's print stream is flushed for "finished" events (buildFinished, targetFinished and taskFinished), and is closed on a buildFinished event.
RecorderEntry
| Modifier and Type | Class and Description |
|---|---|
| public static class | Recorder.ActionChoices
A list of possible values for the |
| public static class | Recorder.VerbosityLevelChoices
A list of possible values for the |
| Modifier and Type | Field and Description |
|---|---|
| private Boolean | append
Whether or not to append. |
| private boolean | emacsMode
Strip task banners if true. |
| private String | filename
The name of the file to record to. |
| private int | loglevel
The level to log at. |
| private static Map | recorderEntries
The list of recorder entries. |
| private Boolean | start
Whether to start or stop recording. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | buildFinished(BuildEvent
ignored. event)Implements org. |
| public void | buildStarted(BuildEvent
ignored. event)Implements org. |
| private void | |
| public void | |
| protected RecorderEntry | Returns: a recorderthe name of the recorder name, Project the current project proj)Gets the recorder that's associated with the passed in name. |
| public void | init()
Overrides org. |
| public void | messageLogged(BuildEvent
ignored. event)Implements org. |
| public void | setAction(Recorder.
The action for the entry to take: start or stop. actionSets the action for the associated recorder entry. |
| public void | setAppend(boolean
if true, append to a previous file. append)Whether or not the logger should append to a previous file. |
| public void | |
| public void | setLoglevel(Recorder.
the level to set. levelSets the level to which this recorder entry should log to. |
| public void | setLogLevel(final LogLevel
the level to set. level)Sets the level to which this recorder entry should log to. |
| public void | |
| public void | subBuildFinished(BuildEvent
ignored. event)Implements org. |
| public void | subBuildStarted(BuildEvent
ignored. event)Implements org. |
| public void | targetFinished(BuildEvent
ignored. event)Implements org. |
| public void | targetStarted(BuildEvent
ignored. event)Implements org. |
| public void | taskFinished(BuildEvent
ignored. event)Implements org. |
| public void | taskStarted(BuildEvent
ignored. event)Implements org. |
| append | back to summary |
|---|---|
| private Boolean append Whether or not to append. Need Boolean to record an unset state (null). | |
| emacsMode | back to summary |
|---|---|
| private boolean emacsMode Strip task banners if true. | |
| filename | back to summary |
|---|---|
| private String filename The name of the file to record to. | |
| loglevel | back to summary |
|---|---|
| private int loglevel The level to log at. A level of -1 means not initialized yet. | |
| recorderEntries | back to summary |
|---|---|
| private static Map<String, RecorderEntry> recorderEntries The list of recorder entries. | |
| start | back to summary |
|---|---|
| private Boolean start Whether to start or stop recording. Need Boolean to record an unset state (null). | |
| Recorder | back to summary |
|---|---|
| public Recorder() | |
| buildFinished | back to summary |
|---|---|
| public void buildFinished(BuildEvent event) Implements org. Cleans recorder registry.
| |
| buildStarted | back to summary |
|---|---|
| public void buildStarted(BuildEvent event) Implements org. Empty implementation required by SubBuildListener interface.
| |
| cleanup | back to summary |
|---|---|
| private void cleanup() cleans recorder registry and removes itself from BuildListener list.
| |
| execute | back to summary |
|---|---|
| public void execute() throws BuildException Overrides org. The main execution.
| |
| getRecorder | back to summary |
|---|---|
| protected RecorderEntry getRecorder(String name, Project proj) throws BuildException Gets the recorder that's associated with the passed in name. If the recorder doesn't exist, then a new one is created.
| |
| init | back to summary |
|---|---|
| public void init() Overrides org. Overridden so we can add the task as build listener.
| |
| messageLogged | back to summary |
|---|---|
| public void messageLogged(BuildEvent event) Implements org. Empty implementation required by SubBuildListener interface.
| |
| setAction | back to summary |
|---|---|
| public void setAction(Recorder. Sets the action for the associated recorder entry.
| |
| setAppend | back to summary |
|---|---|
| public void setAppend(boolean append) Whether or not the logger should append to a previous file.
| |
| setEmacsMode | back to summary |
|---|---|
| public void setEmacsMode(boolean emacsMode) Set emacs mode.
| |
| setLoglevel | back to summary |
|---|---|
| public void setLoglevel(Recorder. Sets the level to which this recorder entry should log to.
| |
| setLogLevel | back to summary |
|---|---|
| public void setLogLevel(final LogLevel level) Sets the level to which this recorder entry should log to.
| |
| setName | back to summary |
|---|---|
| public void setName(String fname) Sets the name of the file to log to, and the name of the recorder entry.
| |
| subBuildFinished | back to summary |
|---|---|
| public void subBuildFinished(BuildEvent event) Implements org. Cleans recorder registry, if this is the subbuild the task has been created in.
| |
| subBuildStarted | back to summary |
|---|---|
| public void subBuildStarted(BuildEvent event) Implements org. Empty implementation required by SubBuildListener interface.
| |
| targetFinished | back to summary |
|---|---|
| public void targetFinished(BuildEvent event) Implements org. Empty implementation required by SubBuildListener interface.
| |
| targetStarted | back to summary |
|---|---|
| public void targetStarted(BuildEvent event) Implements org. Empty implementation required by SubBuildListener interface.
| |
| taskFinished | back to summary |
|---|---|
| public void taskFinished(BuildEvent event) Implements org. Empty implementation required by SubBuildListener interface.
| |
| taskStarted | back to summary |
|---|---|
| public void taskStarted(BuildEvent event) Implements org. Empty implementation required by SubBuildListener interface.
| |
setAction() method.
Possible values include: start and stop.
| Modifier and Type | Field and Description |
|---|---|
| private static final String[] |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String[] | getValues()
Implements abstract org. |
| VALUES | back to summary |
|---|---|
| private static final String[] VALUES | |
| ActionChoices | back to summary |
|---|---|
| public ActionChoices() | |
| getValues | back to summary |
|---|---|
| public String[] getValues() Implements abstract org. Doc from org. This is the only method a subclass needs to implement. | |
setLoglevel() method.
Possible values include: error, warn, info, verbose, debug.
| Access | Constructor and Description |
|---|---|
| public |
| VerbosityLevelChoices | back to summary |
|---|---|
| public VerbosityLevelChoices() | |