Ignore:
Timestamp:
08/05/09 17:48:43 (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: Yes

Module(s): Module Names change impacts.

Description: Describe your changes here...

I have changed that almost all log messages are output to casapy.log,
not to the terminal window. After this change, asap becomes to depend on casapy
and is not running in standalone, because asap have to import taskinit module
to access casalogger.


File:
1 edited

Legend:

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

    r1605 r1612  
    212212        tup = line.split(':',1)
    213213        if len(tup) !=2:
    214             print ('Illegal line #%d\n\t%s\n\tin file "%s"' % (cnt, line, fname))
     214            #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')
    215216            continue
    216217
     
    218219        key = key.strip()
    219220        if not defaultParams.has_key(key):
    220             print ('Bad key "%s" on line %d in %s' % (key, cnt, fname))
     221            #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')
    221223            continue
    222224
     
    228230        try: cval = converter(val)   # try to convert to proper type or raise
    229231        except ValueError, msg:
    230             print ('Bad val "%s" on line #%d\n\t"%s"\n\tin file "%s"\n\t%s' % (val, cnt, line, fname, msg))
     232            #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')
    231234            continue
    232235        else:
     
    343346
    344347# Logging
     348from taskinit import *
    345349from asap._asap import Log as _asaplog
    346350global asaplog
     
    353357def print_log():
    354358    log = asaplog.pop()
    355     if len(log) and rcParams['verbose']: print log
     359    #if len(log) and rcParams['verbose']: print log
     360    if len(log) and rcParams['verbose']: casalog.post( log )
    356361    return
    357362
     
    389394        del gui
    390395    except ImportError:
    391         print "Matplotlib not installed. No plotting available"
     396        #print "Matplotlib not installed. No plotting available"
     397        casalog.post( "Matplotlib not installed. No plotting available", 'WARN' )
    392398
    393399__date__ = '$Date$'.split()[1]
Note: See TracChangeset for help on using the changeset viewer.