python-printr 4.6__tar.gz → 4.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-printr
3
- Version: 4.6
3
+ Version: 4.8
4
4
  Summary: printr
5
5
  Home-page: https://github.com/xjxckk/python-printr/
6
6
  Download-URL: https://github.com/xjxckk/python-printr/archive/refs/tags/v0.1.tar.gz
@@ -7,7 +7,7 @@ class Logger:
7
7
  def __init__(self, log_filepath=None, max_lines=10_000, level='info', name=None, log_to_file=True):
8
8
  filename = Path(sys.argv[0]).stem
9
9
  if not log_filepath:
10
- log_filepath = f'{os.getcwd()}/{filename}.txt'
10
+ log_filepath = f'{os.getcwd()}/logs/{filename}.txt'
11
11
  else:
12
12
  path_tree = log_filepath.split('/') # ['logs', 'bot.txt']
13
13
  if len(path_tree) > 1:
@@ -87,8 +87,8 @@ class Logger:
87
87
  # Rename the current log file to FILE_NAME_2nd_log.txt
88
88
  current_datetime = datetime.now()
89
89
  formatted_datetime = current_datetime.strftime('%Y-%m-%d %H-%M-%S')
90
- archive_log_filepath = log_filepath.replace('.txt', f' {formatted_datetime}.txt')
91
- os.replace(self.log_filepath, self.backup_log_filepath)
90
+ archive_log_filepath = self.log_filepath.replace('.txt', f' {formatted_datetime}.txt')
91
+ os.replace(self.log_filepath, archive_log_filepath)
92
92
 
93
93
  log_file = logging.FileHandler(self.log_filepath, mode='w', encoding='utf-8')
94
94
  log_format = logging.Formatter(fmt=self.indent + '%(levelname)s - %(asctime)s.%(msecs)03d - Line %(lineno)s: %(message)s', datefmt='%Y-%m-%d %H:%M:%S')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-printr
3
- Version: 4.6
3
+ Version: 4.8
4
4
  Summary: printr
5
5
  Home-page: https://github.com/xjxckk/python-printr/
6
6
  Download-URL: https://github.com/xjxckk/python-printr/archive/refs/tags/v0.1.tar.gz
@@ -3,7 +3,7 @@ from setuptools import setup
3
3
  setup(
4
4
  name = 'python-printr',
5
5
  packages = ['printr'],
6
- version = '4.6',
6
+ version = '4.8',
7
7
  install_requires=['coloredlogs'],
8
8
  description = 'printr',
9
9
  url = 'https://github.com/xjxckk/python-printr/',
File without changes
File without changes
File without changes