pyquoks 1.3.0__tar.gz → 1.3.1__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.4
2
2
  Name: pyquoks
3
- Version: 1.3.0
3
+ Version: 1.3.1
4
4
  Summary: Пакет PyPI для часто используемых модулей в проектах diquoks
5
5
  Home-page: https://diquoks.ru
6
6
  Author: Denis Titovets
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = pyquoks
3
- version = 1.3.0
3
+ version = 1.3.1
4
4
  author = Denis Titovets
5
5
  author_email = den232titovets@yandex.ru
6
6
  description = Пакет PyPI для часто используемых модулей в проектах diquoks
@@ -477,12 +477,18 @@ class LoggerService(logging.Logger):
477
477
  Class that provides methods for parallel logging
478
478
  """
479
479
 
480
+ _LOGS_PATH: str | None
481
+ """
482
+ Path to the logs file
483
+ """
484
+
480
485
  def __init__(
481
486
  self,
482
- name: str, file_handling: bool = True,
487
+ name: str,
488
+ path: str = utils.get_path("logs/", only_abspath=True),
483
489
  filename: str = datetime.datetime.now().strftime("%d-%m-%y-%H-%M-%S"),
490
+ file_handling: bool = True,
484
491
  level: int = logging.NOTSET,
485
- path: str = utils.get_path("logs/", only_abspath=True),
486
492
  ) -> None:
487
493
  super().__init__(name, level)
488
494
 
@@ -498,9 +504,10 @@ class LoggerService(logging.Logger):
498
504
 
499
505
  if file_handling:
500
506
  os.makedirs(path, exist_ok=True)
507
+ self._LOG_PATH = path + f"{filename}-{name}.log"
501
508
 
502
509
  file_handler = logging.FileHandler(
503
- path + f"{filename}-{name}.log",
510
+ self._LOG_PATH,
504
511
  encoding="utf-8",
505
512
  )
506
513
  file_handler.setFormatter(
@@ -512,6 +519,12 @@ class LoggerService(logging.Logger):
512
519
  )
513
520
  self.addHandler(file_handler)
514
521
 
522
+ def get_logs_file(self) -> io.BufferedReader:
523
+ """
524
+ :return: Opened file-like object of current logs
525
+ """
526
+ return open(self._LOG_PATH, "rb")
527
+
515
528
  def log_exception(self, e: Exception) -> None:
516
529
  """
517
530
  Logs an exception with detailed traceback
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyquoks
3
- Version: 1.3.0
3
+ Version: 1.3.1
4
4
  Summary: Пакет PyPI для часто используемых модулей в проектах diquoks
5
5
  Home-page: https://diquoks.ru
6
6
  Author: Denis Titovets
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes