Changeset 3272

Show
Ignore:
Timestamp:
01/26/12 21:06:56 (4 months ago)
Author:
erkn
Message:

Refactor logging and change formatting

Location:
branches/mcxtrace-1.0/src/mcrun2
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/mcxtrace-1.0/src/mcrun2/main.py

    r3271 r3272  
    178178 
    179179    # Setup logging 
    180     formatter = logging.Formatter('%(asctime)s - %(message)s') 
     180    formatter = logging.Formatter('%(created)s, %(levelname)8s: %(message)s') 
    181181 
    182182    handler = logging.StreamHandler() 
  • branches/mcxtrace-1.0/src/mcrun2/mcstas.py

    r3271 r3272  
    4848 
    4949        # Run executable 
    50         LOG.debug('CMD: %s %s' % (self.executable, args)) 
     50        LOG.debug('CMD: %s %s', self.executable, args) 
    5151        fid = Popen([self.executable] + args, 
    5252                    stdout=pipe, 
     
    9393        if not options.force_compile and isfile(self.binpath) \ 
    9494               and modified(self.path) < modified(self.binpath): 
    95             LOG.info('Using existing binary: %s' % self.binpath) 
     95            LOG.info('Using existing binary: %s', self.binpath) 
    9696            return  # skip 
    97         LOG.info('Recompiling: %s' % self.binpath) 
     97        LOG.info('Recompiling: %s', self.binpath) 
    9898 
    9999        # Generate C-code 
     
    139139        # Run McStas 
    140140        if not mpi: 
    141             LOG.info('Running: %s' % self.binpath) 
     141            LOG.info('Running: %s', self.binpath) 
    142142            Process(self.binpath).run(args, pipe=pipe) 
    143143        else: 
    144             LOG.info('Running via MPI: %s' % self.binpath) 
     144            LOG.info('Running via MPI: %s', self.binpath) 
    145145            mpi_args = ['-np', str(options.mpi), self.binpath] 
    146146            mpi_args += args