Class ScriptingLogger


  • public class ScriptingLogger
    extends Object
    A class that logs all scripting commands.
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    • Method Detail

      • log

        public void log​(Object source,
                        ScriptingCommand cmd,
                        boolean success)
        Logs the given command.
        Parameters:
        source - the source that logged this command
        cmd - the command that was run
        success - whether the command was successful
      • log

        public void log​(Object source,
                        ScriptingCommand cmd,
                        boolean success,
                        String error)
        Logs the given command.
        Parameters:
        source - the source that logged this command
        cmd - the command that was run
        success - whether the command was successful
        error - an optional error message, null if not available
      • addScriptingListener

        public void addScriptingListener​(ScriptingListener l)
        Adds the given listener to its internal list of listeners.
        Parameters:
        l - the listener to add
      • removeScriptingListener

        public void removeScriptingListener​(ScriptingListener l)
        Removes the given listener from its internal list of listeners.
        Parameters:
        l - the listener to remove
      • notifyScriptingListeners

        protected void notifyScriptingListeners​(ScriptingEvent e)
        Notifies all the listeners about the specified event.
        Parameters:
        e - the event
      • getSingleton

        public static ScriptingLogger getSingleton()
        Returns the singleton instance of the logger.
        Returns:
        the logger instance