From 3dfde0ee5e048cbe6715e7ff3218c61dd3b003fa Mon Sep 17 00:00:00 2001 From: Bryant Howell Date: Mon, 6 Jan 2020 15:05:21 -0600 Subject: [PATCH] Fixed the indentation on the start and end log block methods. --- logger.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/logger.py b/logger.py index d291acd..06a791e 100644 --- a/logger.py +++ b/logger.py @@ -51,12 +51,17 @@ def start_log_block(self): class_path = c.split('.') short_class = class_path[len(class_path)-1] short_class = short_class[:-2] - cur_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()).encode('utf-8') + cur_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + - log_line = '{}vv-- {} : {} {} started --------vv\n'.format(" "*self.log_depth, str(cur_time), short_class, caller_function_name) # Only move the log depth in debug mode if self._log_modes['debug'] is True: self.log_depth += 2 + log_line = '{}vv-- {} : {} {} started --------vv\n'.format(" " * self.log_depth, str(cur_time), short_class, + caller_function_name) + else: + log_line = '{} : {} {} started --------vv\n'.format(str(cur_time), short_class, caller_function_name) + self.__log_handle.write(log_line.encode('utf-8')) def end_log_block(self): @@ -65,10 +70,12 @@ def end_log_block(self): class_path = c.split('.') short_class = class_path[len(class_path)-1] short_class = short_class[:-2] - cur_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()).encode('utf-8') + cur_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) if self._log_modes['debug'] is True: self.log_depth -= 2 - log_line = '{}^^-- {} : {} {} ended --------^^\n'.format(" "*self.log_depth, str(cur_time), short_class, caller_function_name) + log_line = '{}^^-- {} : {} {} ended --------^^\n'.format(" "*self.log_depth, str(cur_time), short_class, caller_function_name) + else: + log_line = '{} : {} {} ended --------^^\n'.format(str(cur_time), short_class, caller_function_name) self.__log_handle.write(log_line.encode('utf-8'))