Ignore:
Timestamp:
08/06/09 15:48:39 (15 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: Yes CAS-729, CAS-1147

Ready to Release: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: No

Module(s): Module Names change impacts.

Description: Describe your changes here...

  1. Added level parameter to print_log()
  2. Replaced casalog.post() to asaplog.push() + print_log().


File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/alma/python/__init__.py

    r1612 r1614  
    213213        if len(tup) !=2:
    214214            #print ('Illegal line #%d\n\t%s\n\tin file "%s"' % (cnt, line, fname))
    215             casalog.post('Illegal line #%d\n\t%s\n\tin file "%s"' % (cnt, line, fname), 'WARN')
     215            asaplog.push('Illegal line #%d\n\t%s\n\tin file "%s"' % (cnt, line, fname))
     216            print_log('WARN')
    216217            continue
    217218
     
    220221        if not defaultParams.has_key(key):
    221222            #print ('Bad key "%s" on line %d in %s' % (key, cnt, fname))
    222             casalog.post('Bad key "%s" on line %d in %s' % (key, cnt, fname), 'WARN')
     223            asaplog.push('Bad key "%s" on line %d in %s' % (key, cnt, fname))
     224            print_log('WARN')
    223225            continue
    224226
     
    231233        except ValueError, msg:
    232234            #print ('Bad val "%s" on line #%d\n\t"%s"\n\tin file "%s"\n\t%s' % (val, cnt, line, fname, msg))
    233             casalog.post('Bad val "%s" on line #%d\n\t"%s"\n\tin file "%s"\n\t%s' % (val, cnt, line, fname, msg), 'WARN')
     235            asaplog.push('Bad val "%s" on line #%d\n\t"%s"\n\tin file "%s"\n\t%s' % (val, cnt, line, fname, msg))
     236            print_log('WARN')
    234237            continue
    235238        else:
     
    355358    asaplog.disable()
    356359
    357 def print_log():
     360def print_log(level='INFO'):
    358361    log = asaplog.pop()
    359362    #if len(log) and rcParams['verbose']: print log
    360     if len(log) and rcParams['verbose']: casalog.post( log )
     363    if len(log) and rcParams['verbose']: casalog.post( log, priority=level )
    361364    return
    362365
     
    395398    except ImportError:
    396399        #print "Matplotlib not installed. No plotting available"
    397         casalog.post( "Matplotlib not installed. No plotting available", 'WARN' )
     400        asaplog.post( "Matplotlib not installed. No plotting available")
     401        print_log('WARN')
    398402
    399403__date__ = '$Date$'.split()[1]
Note: See TracChangeset for help on using the changeset viewer.