Changeset 439


Ignore:
Timestamp:
08/25/2011 11:32:27 AM (11 years ago)
Author:
marcus
Message:

a "log.warning" message issues a python warning automatically

Location:
SHX/trunk/SeismicHandler
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • SHX/trunk/SeismicHandler/basics/command.py

    r437 r439  
    1919from SeismicHandler.basics.error import ShxError 
    2020 
    21 import warnings 
    2221 
    2322class BaseCommand(object): 
     
    7069        # left overs 
    7170        if len(unknown): 
    72             warnings.warn("Unknown qualifiers: %s" % ", ".join(unknown)) 
     71            msg = "Unknown qualifiers: %s" % ", ".join(unknown) 
     72            msgs.sendMessage("log.warning.command", message=msg) 
    7373 
    7474        # transfer parameters (first parser, then direct) 
  • SHX/trunk/SeismicHandler/modules/log.py

    r437 r439  
    139139            logger = getattr(l, mode) 
    140140            logger(message) 
     141            if mode == "warning": 
     142                warnings.warn(message) 
    141143        except: 
    142144            raise ValueError("Unknown logging mode '%s'!" % mode) 
     
    149151    msgs.sendMessage('log.error', message='Log Error Message') 
    150152    msgs.sendMessage('log.debug', message='Log Debug Message') 
     153    msgs.sendMessage('log.warning', message='Log Warning Message') 
    151154    msgs.sendMessage('log.debug.traces.test', 
    152155                                  message='Log Debug Message in "traces.test"') 
Note: See TracChangeset for help on using the changeset viewer.