commit f503758583210583774137766f6e863890146120 Author: vaydheesh Date: Tue Jun 18 23:29:30 2019 +0000 Added: file path and line no in logs diff --git a/apertium/__init__.py b/apertium/__init__.py index 5fc18cf..c462f04 100644 --- a/apertium/__init__.py +++ b/apertium/__init__.py @@ -70,5 +70,5 @@ for pair_path in pair_paths: _update_modes(pair_path) append_pair_path_windows() update_path_windows() -logging.basicConfig(format='%(asctime)s %(message)s', level=logging.WARNING) +logging.basicConfig(format='[%(asctime)s] {%(pathname)s:%(lineno)d} %(levelname)s - %(message)s', level=logging.WARNING) logger = logging.getLogger() diff --git a/apertium/utils.py b/apertium/utils.py index 0d01d5d..d55ee95 100644 --- a/apertium/utils.py +++ b/apertium/utils.py @@ -50,7 +50,7 @@ def execute_pipeline(inp: str, commands: List[List[str]]) -> str: fst.lt_proc(arg, path, input_file.name, output_file.name) end = output_file.read().encode() else: - apertium.logger.warning('%s Calling subprocess %s', __name__, command[0]) + apertium.logger.warning('Calling subprocess %s', command[0]) proc = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE) end, _ = proc.communicate(end) return end.decode()