From 95e325900d348be5ed3ecc3fbc735a2467c8c1e2 Mon Sep 17 00:00:00 2001 From: LBolte29 <97528701+LBolte29@users.noreply.github.com> Date: Thu, 24 Mar 2022 20:11:39 +0100 Subject: [PATCH] Log tweaks (#1546) * add path to logs * add path to logs more info Co-authored-by: jmaslek --- .../log/generation/formatter_with_exceptions.py | 2 +- gamestonk_terminal/parent_classes.py | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/gamestonk_terminal/log/generation/formatter_with_exceptions.py b/gamestonk_terminal/log/generation/formatter_with_exceptions.py index 05badc5c1ee..4074f489422 100644 --- a/gamestonk_terminal/log/generation/formatter_with_exceptions.py +++ b/gamestonk_terminal/log/generation/formatter_with_exceptions.py @@ -76,7 +76,7 @@ class FormatterWithExceptions(logging.Formatter): .replace("\t", " ") .replace("\r", "") .replace("'", "`") - .replace('"', "`") + .replace('"', "``") ) return filtered_text diff --git a/gamestonk_terminal/parent_classes.py b/gamestonk_terminal/parent_classes.py index d14554df9d0..c8ea152ff0d 100644 --- a/gamestonk_terminal/parent_classes.py +++ b/gamestonk_terminal/parent_classes.py @@ -134,7 +134,12 @@ class BaseController(metaclass=ABCMeta): def log_queue(self, message: str) -> None: if self.queue: - logger.info("%s: %s", message, "/".join(self.queue)) + logger.info( + "%s: {path: '%s', queue: '%s'}", + message, + self.PATH, + "/".join(self.queue), + ) @log_start_end(log=logger) def switch(self, an_input: str) -> List[str]: @@ -178,7 +183,13 @@ class BaseController(metaclass=ABCMeta): known_args.cmd = "reset" set_command_location(f"{self.PATH}{known_args.cmd}") - logger.info("CMD: %s", an_input) + logger.info( + "CMD: {path: '%s', known_cmd: '%s', other_args: '%s' input: '%s'}", + self.PATH, + known_args.cmd, + str(other_args), + an_input, + ) self.log_queue("QUEUE") # This is what mutes portfolio issue