diff options
Diffstat (limited to 'aergia/aergia.py')
| -rwxr-xr-x | aergia/aergia.py | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/aergia/aergia.py b/aergia/aergia.py index b2ed74b..77be0fc 100755 --- a/aergia/aergia.py +++ b/aergia/aergia.py @@ -278,14 +278,13 @@ class Aergia(object): # third case: we'd like to return the current value of deepest_frame. previous_frame = None + print('-' * 60) + print('--- Frame Information for ---') + print(deepest_frame) + print(f"{'Filename':<30} {'Function':<30} {'Line':<10}") while previous_frame is not deepest_frame: previous_frame = deepest_frame refs = gc.get_referrers(deepest_frame) - print('-' * 60) - print('--- Frame Information for ---') - print(previous_frame) - print(f"{'Frame':<10} {'Filename':<30} {'Function':<30} {'Line':<10}") - index = 0 for r in refs: if inspect.isframe(r) and \ Aergia._should_trace(r.f_code.co_filename): @@ -295,10 +294,8 @@ class Aergia(object): filename = co.co_filename filename = (filename if len(filename) <= 30 else filename[-30:]) line_no = r.f_lineno - print(f"{index:<10} {filename:<30} {func_name:<30} {line_no:<10}") - index +=1 - print('--- End of Frame Information ---') - print(f'finished with {deepest_frame}') + print(f"{filename:<30} {func_name:<30} {line_no:<10}") + print(f'finished with {deepest_frame}') return deepest_frame @staticmethod |
