Mercurial > lcfOS
comparison python/zcc.py @ 281:4496cae24d7f
Improved logview
author | Windel Bouwman |
---|---|
date | Sat, 02 Nov 2013 11:11:40 +0100 |
parents | 56d37ed4b4d2 |
children | 1c7c1e619be8 |
comparison
equal
deleted
inserted
replaced
280:02385f62f250 | 281:4496cae24d7f |
---|---|
5 import codegenarm | 5 import codegenarm |
6 from optimize import optimize | 6 from optimize import optimize |
7 import outstream | 7 import outstream |
8 import hexfile | 8 import hexfile |
9 import logging | 9 import logging |
10 | |
11 logformat='%(asctime)s|%(levelname)s|%(name)s|%(message)s' | |
10 | 12 |
11 def logLevel(s): | 13 def logLevel(s): |
12 numeric_level = getattr(logging, s.upper(), None) | 14 numeric_level = getattr(logging, s.upper(), None) |
13 if not isinstance(numeric_level, int): | 15 if not isinstance(numeric_level, int): |
14 raise ValueError('Invalid log level: {}'.format(s)) | 16 raise ValueError('Invalid log level: {}'.format(s)) |
44 # Code generation: | 46 # Code generation: |
45 cg = codegenarm.ArmCodeGenerator(outs) | 47 cg = codegenarm.ArmCodeGenerator(outs) |
46 obj = cg.generate(ircode) | 48 obj = cg.generate(ircode) |
47 return True | 49 return True |
48 | 50 |
49 logformat='%(asctime)s|%(levelname)s|%(name)s|%(message)s' | |
50 | |
51 def main(args): | 51 def main(args): |
52 logging.basicConfig(format=logformat, level=args.log) | 52 logging.basicConfig(format=logformat, level=args.log) |
53 src = args.source.read() | 53 src = args.source.read() |
54 args.source.close() | 54 args.source.close() |
55 diag = ppci.DiagnosticsManager() | 55 diag = ppci.DiagnosticsManager() |