Ignore:
Timestamp:
03/07/11 12:49:44 (8 years ago)
Author:
aspidites
Message:

Patch by Aspidites:

  • converted print statements to logging messages.
  • all of parpg's log messages go to the same file, but are differenciated by their class names
  • need to find a way to manipulate fife's log level
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/active/character_customization/game/parpg/gamemodel.py

    r794 r797  
    3838 
    3939import yaml 
     40 
     41logger = logging.getLogger('gamemodel') 
    4042 
    4143class GameModel(object): 
     
    303305        @param position: X,Y coordinates passed from engine.changeMap 
    304306        @return: fife.Location""" 
    305         print position 
     307        logging.debug(position) 
    306308        coord = fife.DoublePoint3D(float(position[0]), float(position[1]), 0) 
    307309        location = fife.Location(self.active_map.agent_layer) 
     
    472474        map_obj = self.fife_model.getObject(str(object_id), "PARPG") 
    473475        if not map_obj: 
    474             print ''.join(['Object with inst_id=', str(object_id),  
    475                            ' ns=PARPG', \ 
    476                            ' could not be found. Omitting...']) 
     476            logging.warning("Object with inst_id={0}, ns=PARPG, " 
     477                                  "could not be found. " 
     478                                  "Omitting...".format(str(obj_id))) 
    477479 
    478480        x_pos = agent["Position"][0] 
     
    745747            except SyntaxError as error: 
    746748                assert(isinstance(error, SyntaxError)) 
    747                 print "Error parsing file " + xml_file + ": " + error.msg 
    748                 #TODO: We may want to make this an fatal error later. 
     749                logging.critical("Error parsing file {0}: " 
     750                                       "{1}".format(xml_file, error.msg)) 
     751                sys.exit(1) 
    749752     
    750753    def getDialogues(self): 
Note: See TracChangeset for help on using the changeset viewer.