Magentix2  2.1.1
jason.stdlib.setlogfile Class Reference
Inheritance diagram for jason.stdlib.setlogfile:
Collaboration diagram for jason.stdlib.setlogfile:

List of all members.

Public Member Functions

Object execute (TransitionSystem ts, Unifier un, Term[] args) throws Exception

Detailed Description

This class represents the internal action for adding a file handler with logging purposes

Author:
Bexy Alfonso Espinosa

Definition at line 17 of file setlogfile.java.


Member Function Documentation

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;
    }

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables