python-sdk-local 0.0.43__tar.gz → 0.0.44__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-sdk-local
3
- Version: 0.0.43
3
+ Version: 0.0.44
4
4
  Summary: PyPI Package for Circles Python SDK Local Python
5
5
  Home-page: https://github.com/circles
6
6
  Author: Circles
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-sdk-local
3
- Version: 0.0.43
3
+ Version: 0.0.44
4
4
  Summary: PyPI Package for Circles Python SDK Local Python
5
5
  Home-page: https://github.com/circles
6
6
  Author: Circles
@@ -4,6 +4,9 @@ from datetime import datetime
4
4
 
5
5
  class MiniLogger:
6
6
 
7
+ # TODO Can we so one generic function call by all
8
+ # TODO Shall we user the Python logging package?
9
+
7
10
  @staticmethod
8
11
  def start(message: str = "", object: dict = None):
9
12
  """
@@ -44,6 +47,20 @@ class MiniLogger:
44
47
  else:
45
48
  print(f"{datetime.now()} - INFO {message} - {str(object)}")
46
49
 
50
+ @staticmethod
51
+ def warning(message: str = "", object: dict = None):
52
+ """
53
+ Print a log message with the current time.
54
+
55
+ Parameters:
56
+ message (str): The message to be printed.
57
+ object (dict): The object to be printed.
58
+ """
59
+ if object is None:
60
+ print(f"{datetime.now()} - WARNING - {message}")
61
+ else:
62
+ print(f"{datetime.now()} - WARNING {message} - {str(object)}")
63
+
47
64
  @staticmethod
48
65
  def error(message: str = "", object: dict = None):
49
66
  """
@@ -59,3 +76,19 @@ class MiniLogger:
59
76
  else:
60
77
  print(
61
78
  f"{datetime.now()} - ERROR - {message} - {str(object)}", file=sys.stderr)
79
+
80
+ @staticmethod
81
+ def exception(message: str = "", object: dict = None):
82
+ """
83
+ Print a log error message with the current time.
84
+
85
+ Parameters:
86
+ message (str): The message to be printed.
87
+ object (dict): The object to be printed.
88
+ """
89
+ if object is None:
90
+ print(f"{datetime.now()} - EXCEPTION - {message}",
91
+ file=sys.stderr)
92
+ else:
93
+ print(
94
+ f"{datetime.now()} - EXCEPTION- {message} - {str(object)}", file=sys.stderr)
@@ -3,7 +3,7 @@ import setuptools
3
3
  # python -m build needs pyproject.toml or setup.py
4
4
  setuptools.setup(
5
5
  name='python-sdk-local',
6
- version='0.0.43', # https://pypi.org/project/python-sdk-local/
6
+ version='0.0.44', # https://pypi.org/project/python-sdk-local/
7
7
  author="Circles",
8
8
  author_email="info@circles.life",
9
9
  description="PyPI Package for Circles Python SDK Local Python",