瀏覽代碼

Change logger to display absolute source file path instead of relative path

Yann Weber 8 年之前
父節點
當前提交
468cf2a383
共有 1 個檔案被更改,包括 1 行新增4 行删除
  1. 1
    4
      lodel/logger.py

+ 1
- 4
lodel/logger.py 查看文件

@@ -96,10 +96,7 @@ def remove_console_handlers():
96 96
 def log(lvl, msg, *args, **kwargs):
97 97
     caller = logger.findCaller() # Opti warning : small overhead
98 98
     extra = {
99
-        '_pathname': os.path.relpath(
100
-                                        caller[0],
101
-                                        start=Settings.lib_path
102
-        ), # os.path.relpath add another small overhead
99
+        '_pathname': os.path.abspath(caller[0]),
103 100
         '_lineno': caller[1],
104 101
         '_funcName': caller[2],
105 102
     }

Loading…
取消
儲存