Skip to content

Commit

Permalink
minor: fixed potential problem with verbose logging -
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Fiers committed Oct 15, 2012
1 parent 6220814 commit 1eeb22e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/python/moa/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ def format(self, record):
record.colon = ""
record.coloff = ""

caller = traceback.extract_stack()[-11]
trext = traceback.extract_stack()
if len(trext) > 11:
caller = trext[-11]
else:
caller = trext[0]

record.file = caller[0]
module = os.path.basename(record.file).replace('.py', '')
if module == '__init__':
Expand Down

0 comments on commit 1eeb22e

Please sign in to comment.