Conditions | 4 |
Total Lines | 11 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import logging |
||
9 | def filter(self, record): |
||
10 | pathname = record.pathname |
||
11 | record.relpath = None |
||
12 | abs_sys_paths = [os.path.abspath(p) for p in sys.path] |
||
13 | for path in sorted(abs_sys_paths, key=len, reverse=True): |
||
14 | if not path.endswith(os.sep): |
||
15 | path += os.sep |
||
16 | if pathname.startswith(path): |
||
17 | record.relpath = os.path.relpath(pathname, path) |
||
18 | break |
||
19 | return True |
||
20 | |||
28 |