Magentix2
2.1.1
|
Public Member Functions | |
Object | execute (TransitionSystem ts, Unifier un, Term[] args) throws Exception |
This class represents the internal action for adding a file handler with logging purposes
Definition at line 17 of file setlogfile.java.
Object jason.stdlib.setlogfile.execute | ( | TransitionSystem | ts, |
Unifier | un, | ||
Term[] | args | ||
) | throws Exception |
Definition at line 26 of file setlogfile.java.
{ if ((args.length == 1)&&(args[0].isString())){ String filename = ((StringTermImpl)args[0]).getString(); FileHandler fh = new FileHandler(filename,true); fh.setFormatter(new MASConsoleLogFormatter()); ts.getLogger().getParent().addHandler(fh) ; //ts.getLogger().setUseParentHandlers(false); //This must be modified in order to turn off the default console of Jason }else { throw new JasonException("Wrong arguments for setting the log file. It must be provided one string argument!"); } return true; }