advdbg 0.2.4__tar.gz → 0.2.6__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: advdbg
3
- Version: 0.2.4
3
+ Version: 0.2.6
4
4
  Summary: Minimalist colorful debug logger
5
5
  Author-email: Darkey <weplayok3@gmail.com>, WinFun <placeholder@gmail.com>
6
6
  License: MIT
@@ -40,7 +40,7 @@ Available types:
40
40
  `SUCCESS`
41
41
 
42
42
  Returns:
43
- [title of your debug at DATE AND TIME] Text to debug!
43
+ Info - title of your debug (01.07.2026, 06:34:53) | Text to debug!
44
44
 
45
45
  Configure existing category:
46
46
  dbgVar.cfg(title='REQUEST')
@@ -48,9 +48,13 @@ dbgVar.cfg(title='REQUEST')
48
48
  BEFORE: title of your debug
49
49
  AFTER: REQUEST
50
50
 
51
- ## Change Log: v0.2.4
51
+ ## Change Log: v0.2.6
52
52
 
53
- - Hotfix 0.2.3
53
+ - Added a checker of output list.
54
+
55
+ ## Requirements
56
+
57
+ - Python >3.6
54
58
 
55
59
  ## LICENSE
56
60
 
@@ -25,7 +25,7 @@ Available types:
25
25
  `SUCCESS`
26
26
 
27
27
  Returns:
28
- [title of your debug at DATE AND TIME] Text to debug!
28
+ Info - title of your debug (01.07.2026, 06:34:53) | Text to debug!
29
29
 
30
30
  Configure existing category:
31
31
  dbgVar.cfg(title='REQUEST')
@@ -33,9 +33,13 @@ dbgVar.cfg(title='REQUEST')
33
33
  BEFORE: title of your debug
34
34
  AFTER: REQUEST
35
35
 
36
- ## Change Log: v0.2.4
36
+ ## Change Log: v0.2.6
37
37
 
38
- - Hotfix 0.2.3
38
+ - Added a checker of output list.
39
+
40
+ ## Requirements
41
+
42
+ - Python >3.6
39
43
 
40
44
  ## LICENSE
41
45
 
@@ -11,6 +11,7 @@ __version__ = '0.2.4'
11
11
  from .core import AdvDBG
12
12
 
13
13
  from .analyze import Breakpoint
14
+ import requests
14
15
 
15
16
  __all__ = ['AdvDBG', 'Breakpoint']
16
17
 
@@ -1,5 +1,6 @@
1
1
  import threading
2
2
  import time
3
+ from datetime import datetime
3
4
 
4
5
  class Breakpoint:
5
6
  def __init__(self, delay: int | float = 30):
@@ -0,0 +1,285 @@
1
+ '''
2
+ Welcome to Advanced Debug.
3
+ Core module.
4
+ '''
5
+
6
+ import os
7
+ from datetime import datetime
8
+ import random
9
+ from typing import Dict, Any, Optional, List
10
+
11
+ # from .colors import Colors
12
+ class Colors:
13
+ WARN = ""
14
+ ERROR = ""
15
+ INFO = ""
16
+ SUCCESS = ""
17
+
18
+ listPhrases = ['Writting some lines.', "Don't forgot to define!", 'Waiting for your command.']
19
+ randomPhrase = random.choice(listPhrases)
20
+
21
+ class AdvDBG:
22
+ _category_store: Dict[str, Dict[str, Any]] = {}
23
+ _defined_categories: Dict[str, 'AdvDBG'] = {}
24
+
25
+ def __init__(self, title='Debug', activated=False, notify=False, output: Optional[List[str]] = None, legacy=False):
26
+ if isinstance(title, str) and isinstance(activated, bool) and isinstance(notify, bool):
27
+ self.title = title
28
+ self.activated = False
29
+ self._defed = False
30
+ self.notify = notify
31
+ self.output = output or ['console']
32
+ self.legacy = legacy
33
+ else:
34
+ raise ValueError('Some parameters do not match required types')
35
+
36
+ # Валидация output
37
+ self._validate_output(self.output)
38
+
39
+ if title not in self._category_store:
40
+ self._category_store[title] = {}
41
+ if title not in self._defined_categories:
42
+ self._defined_categories[title] = self
43
+
44
+ def _validate_output(self, output_list: List[str]) -> None:
45
+ """Валидирует список output"""
46
+ if output_list is None:
47
+ return
48
+
49
+ # Проверка на допустимые значения
50
+ allowed = {'console', 'file'}
51
+ for output_type in output_list:
52
+ if output_type not in allowed:
53
+ print(f"{Colors.ERROR} Error - AdvDBG | Error when reading the output type: Detected disallowed output. Please use console or file.\033[0m")
54
+ raise ValueError(f"Disallowed output type: {output_type}")
55
+
56
+ # Проверка на повторяющиеся значения
57
+ if len(output_list) != len(set(output_list)):
58
+ # Находим дубликаты
59
+ seen = set()
60
+ duplicates = set()
61
+ for item in output_list:
62
+ if item in seen:
63
+ duplicates.add(item)
64
+ else:
65
+ seen.add(item)
66
+
67
+ print(f"{Colors.ERROR} Error - AdvDBG | {len(duplicates)} repeating output types were found. Please, delete repeating types and try again.\033[0m")
68
+ raise ValueError(f"Repeating output types: {', '.join(duplicates)}")
69
+
70
+ @classmethod
71
+ def define(cls, title: str = 'Debug', activated: bool = True, notify: bool = False, output: Optional[List[str]] = None, legacy: bool = False):
72
+ '''Defines your debug category.
73
+ :param title: Title of your category
74
+ :param activated: Toggle availability of category
75
+ :param notify: Toggles notification if category is not activated
76
+ :param output: Where logger will save lines?
77
+ :param legacy: Use old style?'''
78
+
79
+ # Валидация перед созданием экземпляра
80
+ output = output or ['console']
81
+
82
+ # Проверка на допустимые значения
83
+ allowed = {'console', 'file'}
84
+ for output_type in output:
85
+ if output_type not in allowed:
86
+ print(f"{Colors.ERROR} Error - AdvDBG | Error when reading the output type: Detected disallowed output. Please use console or file.\033[0m")
87
+ raise ValueError(f"Disallowed output type: {output_type}")
88
+
89
+ # Проверка на повторяющиеся значения
90
+ if len(output) != len(set(output)):
91
+ # Находим дубликаты
92
+ seen = set()
93
+ duplicates = set()
94
+ for item in output:
95
+ if item in seen:
96
+ duplicates.add(item)
97
+ else:
98
+ seen.add(item)
99
+
100
+ print(f"{Colors.ERROR} Error - AdvDBG | {len(duplicates)} repeating output types were found. Please, delete repeating types and try again.\033[0m")
101
+ raise ValueError(f"Repeating output types: {', '.join(duplicates)}")
102
+
103
+ inst = cls(title, activated, notify, output, legacy)
104
+ inst.title = title
105
+ inst.activated = True
106
+ inst.notify = notify
107
+ inst.output = output
108
+ inst.legacy = legacy
109
+ inst._defed = True
110
+
111
+ cls._category_store[title] = {
112
+ 'title': title,
113
+ 'activated': activated,
114
+ 'notify': notify,
115
+ 'output': output,
116
+ 'legacy': legacy,
117
+ 'created_at': datetime.now()
118
+ }
119
+ cls._defined_categories[title] = inst
120
+ return inst
121
+
122
+ @classmethod
123
+ def get_category_settings(cls, category: str) -> Optional[Dict[str, Any]]:
124
+ if category in cls._category_store:
125
+ return cls._category_store[category].copy()
126
+ return None
127
+
128
+ @classmethod
129
+ def get_all_categories(cls) -> List[str]:
130
+ return list(cls._category_store.keys())
131
+
132
+ @classmethod
133
+ def export_all_data(cls) -> Dict[str, Any]:
134
+ return {
135
+ 'categories': cls._category_store.copy(),
136
+ 'total_categories': len(cls._category_store),
137
+ 'export_timestamp': datetime.now().isoformat(),
138
+ 'version': '1.0'
139
+ }
140
+
141
+ def _write_to_log(self, text, log_type='INFO'):
142
+ '''For-Module only method.'''
143
+ if not 'file' in self.output:
144
+ return
145
+
146
+ try:
147
+ # Creating logs directory relative to the current working directory
148
+ logs_dir = os.path.join(os.getcwd(), 'logs')
149
+ os.makedirs(logs_dir, exist_ok=True)
150
+
151
+ current_date = datetime.now().strftime("%d.%m.%Y")
152
+ filename = f"log_{current_date}.txt"
153
+ filepath = os.path.join(logs_dir, filename)
154
+
155
+ current_time = datetime.now().strftime("%H:%M:%S")
156
+ log_entry = f"{self.title} {current_time} | {text}\n"
157
+
158
+ file_exists = os.path.exists(filepath)
159
+
160
+ with open(filepath, 'a', encoding='utf-8') as f:
161
+ if not file_exists:
162
+ f.write(f"/// Advanced Debugger\n")
163
+ f.write(f"Category: {self.title}\n")
164
+ f.write(randomPhrase)
165
+ f.write("\n\n")
166
+
167
+ f.write(log_entry)
168
+
169
+ except Exception as e:
170
+ print(f"\033[33mWARNING\033[0m | Failed to write to log file: {e}")
171
+
172
+ def info(self, text):
173
+ """Print debug information
174
+ Type: INFO
175
+
176
+ :param text: Text to show"""
177
+ if not isinstance(text, str):
178
+ try:
179
+ text = str(text)
180
+ except Exception as e:
181
+ text = f"Cannot convert to string format: {e}"
182
+
183
+ if self.activated:
184
+ if self.legacy and 'console' in self.output:
185
+ print(f'[\033[90mINFO \033[95m{self.title} at {datetime.now().strftime("%D, %H:%M:%S")}\033[0m] {text} \033[0m')
186
+ elif not self.legacy and 'console' in self.output:
187
+ print(f'{Colors.INFO} Info - {self.title} ({datetime.now().strftime("%D, %H:%M:%S")}) | {text}\033[0m')
188
+ if 'file' in self.output:
189
+ self._write_to_log(text, 'INFO')
190
+ elif self.notify:
191
+ print(f'Notification from {self.title}: Tried to output when disactivated.\n\033[93mTip: \033[0mIf you are did not want to saw these notifications, turn off NOTIFY property with using notify=False\033[0m')
192
+ else:
193
+ return
194
+
195
+ def warn(self, text):
196
+ if not isinstance(text, str):
197
+ try:
198
+ text = str(text)
199
+ except Exception as e:
200
+ text = f"Cannot convert to string format: {e}"
201
+
202
+ if self.activated:
203
+ if self.legacy and 'console' in self.output:
204
+ print(f'[\033[90mWARN \033[95m{self.title} at {datetime.now().strftime("%D, %H:%M:%S")}\033[0m] {text} \033[0m')
205
+ elif not self.legacy and 'console' in self.output:
206
+ print(f'{Colors.WARN} Warn - {self.title} ({datetime.now().strftime("%D, %H:%M:%S")}) | {text}\033[0m')
207
+ if 'file' in self.output:
208
+ self._write_to_log(text, 'WARN')
209
+ elif self.notify:
210
+ print(f'Notification from {self.title}: Tried to output when disactivated.\n\033[93mTip: \033[0mIf you are did not want to saw these notifications, turn off NOTIFY property with using notify=False')
211
+ else:
212
+ return
213
+
214
+ def success(self, text):
215
+ if not isinstance(text, str):
216
+ try:
217
+ text = str(text)
218
+ except Exception as e:
219
+ text = f"Cannot convert to string format: {e}"
220
+
221
+ if self.activated:
222
+ if self.legacy and 'console' in self.output:
223
+ print(f'[\033[90mSUCCESS \033[95m{self.title} at {datetime.now().strftime("%D, %H:%M:%S")}\033[0m] {text} \033[0m')
224
+ elif not self.legacy and 'console' in self.output:
225
+ print(f'{Colors.SUCCESS} Success - {self.title} ({datetime.now().strftime("%D, %H:%M:%S")}) | {text}\033[0m')
226
+ if 'file' in self.output:
227
+ self._write_to_log(text, 'SUCCESS')
228
+ elif self.notify:
229
+ print(f'Notification from {self.title}: Tried to output when disactivated.\n\033[93mTip: \033[0mIf you are did not want to saw these notifications, turn off NOTIFY property with using notify=False')
230
+ else:
231
+ return
232
+
233
+ def error(self, text):
234
+ if not isinstance(text, str):
235
+ try:
236
+ text = str(text)
237
+ except Exception as e:
238
+ text = f"Cannot convert to string format: {e}"
239
+
240
+ if self.activated:
241
+ if self.legacy:
242
+ print(f'[\033[33mERROR \033[95m{self.title} at {datetime.now().strftime("%D, %H:%M:%S")}\033[0m] {text} \033[0m')
243
+ elif not self.legacy:
244
+ print(f'{Colors.ERROR} Error - {self.title} ({datetime.now().strftime("%D, %H:%M:%S")}) | {text}\033[0m')
245
+ if 'file' in self.output:
246
+ self._write_to_log(text, 'ERROR')
247
+ elif self.notify:
248
+ print(f'Notification from {self.title}: Tried to output when disactivated.\n\033[93mTip: \033[0mIf you are did not want to saw these notifications, turn off NOTIFY property with using notify=False')
249
+ else:
250
+ return
251
+
252
+ def notification(self, text):
253
+ """This type is deprecated."""
254
+ print('Type "Notification" is deprecated. Please, change it to another.')
255
+
256
+ def cfg(self, activated=None, title: str = 'Debug', notify: bool = True, output: Optional[List[str]] = None):
257
+ '''Configure existing category'''
258
+ output = output or ['console']
259
+
260
+ # Валидация нового output
261
+ self._validate_output(output)
262
+
263
+ if activated is not None:
264
+ self.activated = activated
265
+ if self.activated is False:
266
+ self.notify = notify
267
+ elif title is not None:
268
+ self.title = title
269
+ elif output is not None:
270
+ self.output = output
271
+
272
+ if self.title in self._category_store:
273
+ self._category_store[self.title]['activated'] = self.activated
274
+ self._category_store[self.title]["title"] = self.title
275
+ self._category_store[self.title]["output"] = self.output
276
+
277
+ return self
278
+
279
+ def __call__(self, text):
280
+ if not isinstance(text, str):
281
+ try:
282
+ text = str(text)
283
+ except Exception as e:
284
+ text = f"Cannot convert to string format: {e}"
285
+ self.info(text)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: advdbg
3
- Version: 0.2.4
3
+ Version: 0.2.6
4
4
  Summary: Minimalist colorful debug logger
5
5
  Author-email: Darkey <weplayok3@gmail.com>, WinFun <placeholder@gmail.com>
6
6
  License: MIT
@@ -40,7 +40,7 @@ Available types:
40
40
  `SUCCESS`
41
41
 
42
42
  Returns:
43
- [title of your debug at DATE AND TIME] Text to debug!
43
+ Info - title of your debug (01.07.2026, 06:34:53) | Text to debug!
44
44
 
45
45
  Configure existing category:
46
46
  dbgVar.cfg(title='REQUEST')
@@ -48,9 +48,13 @@ dbgVar.cfg(title='REQUEST')
48
48
  BEFORE: title of your debug
49
49
  AFTER: REQUEST
50
50
 
51
- ## Change Log: v0.2.4
51
+ ## Change Log: v0.2.6
52
52
 
53
- - Hotfix 0.2.3
53
+ - Added a checker of output list.
54
+
55
+ ## Requirements
56
+
57
+ - Python >3.6
54
58
 
55
59
  ## LICENSE
56
60
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "advdbg"
7
- version = "0.2.4"
7
+ version = "0.2.6"
8
8
  authors = [
9
9
  {name = "Darkey", email = "weplayok3@gmail.com"}, {name = "WinFun", email = "placeholder@gmail.com"}
10
10
  ]
@@ -1,234 +0,0 @@
1
- '''
2
- Welcome to Advanced Debug.
3
- Core module.
4
- '''
5
-
6
- import os
7
- from datetime import datetime
8
- import random
9
- from typing import Dict, Any, Optional, List
10
-
11
- from .colors import Colors
12
-
13
- listPhrases = ['Writting some lines.', "Don't forgot to define!", 'Waiting for your command.']
14
- randomPhrase = random.choice(listPhrases)
15
-
16
- class AdvDBG:
17
- _category_store: Dict[str, Dict[str, Any]] = {}
18
- _defined_categories: Dict[str, 'AdvDBG'] = {}
19
-
20
- def __init__(self, title='DEBUG', activated=False, notify=False, logging=True, legacy=False):
21
- if isinstance(title, str) and isinstance(activated, bool) and isinstance(notify, bool):
22
- self.title = title
23
- self.activated = False
24
- self._defed = False
25
- self.notify = notify
26
- self.logging = logging
27
- self.legacy = legacy
28
- else:
29
- raise ValueError('Some parameters do not match required types')
30
-
31
- if title not in self._category_store:
32
- self._category_store[title] = {}
33
- if title not in self._defined_categories:
34
- self._defined_categories[title] = self
35
-
36
- @classmethod
37
- def define(cls, title='DEBUG', activated=True, notify=False, logging=True, legacy=False):
38
- '''Defines your debug category.
39
- :param title: Title of your category
40
- :param activated: Toggle availability of category
41
- :param notify: Toggles notification if category is not activated
42
- :param logging: Toggles is it logging
43
- :param legacy: Use old style?'''
44
- inst = cls(title, activated, notify, logging, legacy)
45
- inst.title = title
46
- inst.activated = True
47
- inst.notify = notify
48
- inst.logging = logging
49
- inst.legacy = legacy
50
- inst._defed = True
51
-
52
- cls._category_store[title] = {
53
- 'title': title,
54
- 'activated': activated,
55
- 'notify': notify,
56
- 'logging': logging,
57
- 'legacy': legacy,
58
- 'created_at': datetime.now()
59
- }
60
- cls._defined_categories[title] = inst
61
- return inst
62
-
63
- @classmethod
64
- def get_category_settings(cls, category: str) -> Optional[Dict[str, Any]]:
65
- if category in cls._category_store:
66
- return cls._category_store[category].copy()
67
- return None
68
-
69
- @classmethod
70
- def get_all_categories(cls) -> List[str]:
71
- return list(cls._category_store.keys())
72
-
73
- @classmethod
74
- def export_all_data(cls) -> Dict[str, Any]:
75
- return {
76
- 'categories': cls._category_store.copy(),
77
- 'total_categories': len(cls._category_store),
78
- 'export_timestamp': datetime.now().isoformat(),
79
- 'version': '1.0'
80
- }
81
-
82
- def _write_to_log(self, text, log_type='INFO'):
83
- '''For-Module only method.'''
84
- if not self.logging:
85
- return
86
-
87
- try:
88
- # Creating logs directory relative to the current working directory
89
- logs_dir = os.path.join(os.getcwd(), 'logs')
90
- os.makedirs(logs_dir, exist_ok=True)
91
-
92
- current_date = datetime.now().strftime("%d.%m.%Y")
93
- filename = f"log_{current_date}.txt"
94
- filepath = os.path.join(logs_dir, filename)
95
-
96
- current_time = datetime.now().strftime("%H:%M:%S")
97
- log_entry = f"{self.title} {current_time} | {text}\n"
98
-
99
- file_exists = os.path.exists(filepath)
100
-
101
- with open(filepath, 'a', encoding='utf-8') as f:
102
- if not file_exists:
103
- f.write(f"/// Advanced Debugger\n")
104
- f.write(f"Category: {self.title}\n")
105
- f.write(randomPhrase)
106
- f.write("\n\n")
107
-
108
- f.write(log_entry)
109
-
110
- except Exception as e:
111
- print(f"\033[33mWARNING\033[0m | Failed to write to log file: {e}")
112
-
113
- def info(self, text):
114
- """Print debug information
115
- Type: INFO
116
-
117
- :param text: Text to show"""
118
- if not isinstance(text, str):
119
- try:
120
- text = str(text)
121
- except Exception as e:
122
- text = f"Cannot convert to string format: {e}"
123
-
124
- if self.activated:
125
- if self.legacy:
126
- print(f'[\033[90mINFO \033[95m{self.title} at {datetime.now().strftime("%D, %H:%M:%S")}\033[0m] {text} \033[0m')
127
- elif not self.legacy:
128
- print(f'{Colors.INFO} Info - {self.title} ({datetime.now().strftime("%D, %H:%M:%S")}) | {text}\033[0m')
129
- if self.logging:
130
- self._write_to_log(text, 'INFO')
131
- elif self.notify:
132
- print(f'Notification from {self.title}: Tried to output when disactivated.\n\033[93mTip: \033[0mIf you are did not want to saw these notifications, turn off NOTIFY property with using notify=False\033[0m')
133
- else:
134
- return
135
-
136
- def warn(self, text):
137
- if not isinstance(text, str):
138
- try:
139
- text = str(text)
140
- except Exception as e:
141
- text = f"Cannot convert to string format: {e}"
142
-
143
- if self.activated:
144
- if self.legacy:
145
- print(f'[\033[90mWARN \033[95m{self.title} at {datetime.now().strftime("%D, %H:%M:%S")}\033[0m] {text} \033[0m')
146
- elif not self.legacy:
147
- print(f'{Colors.WARN} Warn - {self.title} ({datetime.now().strftime("%D, %H:%M:%S")}) | {text}\033[0m')
148
- if self.logging:
149
- self._write_to_log(text, 'WARN')
150
- elif self.notify:
151
- print(f'Notification from {self.title}: Tried to output when disactivated.\n\033[93mTip: \033[0mIf you are did not want to saw these notifications, turn off NOTIFY property with using notify=False')
152
- else:
153
- return
154
-
155
- def success(self, text):
156
- if not isinstance(text, str):
157
- try:
158
- text = str(text)
159
- except Exception as e:
160
- text = f"Cannot convert to string format: {e}"
161
-
162
- if self.activated:
163
- if self.legacy:
164
- print(f'[\033[90mSUCCESS \033[95m{self.title} at {datetime.now().strftime("%D, %H:%M:%S")}\033[0m] {text} \033[0m')
165
- elif not self.legacy:
166
- print(f'{Colors.SUCCESS} Success - {self.title} ({datetime.now().strftime("%D, %H:%M:%S")}) | {text}\033[0m')
167
- if self.logging:
168
- self._write_to_log(text, 'SUCCESS')
169
- elif self.notify:
170
- print(f'Notification from {self.title}: Tried to output when disactivated.\n\033[93mTip: \033[0mIf you are did not want to saw these notifications, turn off NOTIFY property with using notify=False')
171
- else:
172
- return
173
-
174
-
175
- def error(self, text):
176
- if not isinstance(text, str):
177
- try:
178
- text = str(text)
179
- except Exception as e:
180
- text = f"Cannot convert to string format: {e}"
181
-
182
- if self.activated:
183
- if self.legacy:
184
- print(f'[\033[33mERROR \033[95m{self.title} at {datetime.now().strftime("%D, %H:%M:%S")}\033[0m] {text} \033[0m')
185
- elif not self.legacy:
186
- print(f'{Colors.ERROR} Error - {self.title} ({datetime.now().strftime("%D, %H:%M:%S")}) | {text}')
187
- if self.logging:
188
- self._write_to_log(text, 'ERROR')
189
- elif self.notify:
190
- print(f'Notification from {self.title}: Tried to output when disactivated.\n\033[93mTip: \033[0mIf you are did not want to saw these notifications, turn off NOTIFY property with using notify=False')
191
- else:
192
- return
193
-
194
- def notification(self, text):
195
- if not isinstance(text, str):
196
- try:
197
- text = str(text)
198
- except Exception as e:
199
- text = f"Cannot convert to string format: {e}"
200
-
201
- if self.activated:
202
- print(f'[\033[94mNOTIFICATION \033[0m{self.title} at {datetime.now().strftime("%D, %H:%M:%S")}\033[0m] \033[94m{text}\033[0m')
203
- if self.logging:
204
- self._write_to_log(text, 'NOTIFICATION')
205
- elif self.notify:
206
- print(f'Notification from {self.title}: Tried to output when disactivated.\n\033[93mTip: \033[0mIf you are did not want to saw these notifications, turn off NOTIFY property with using notify=False')
207
- else:
208
- return
209
-
210
- def cfg(self, activated=None, title='DEBUG', notify=True, logging=True):
211
- '''Configure existing category'''
212
- if activated is not None:
213
- self.activated = activated
214
- if self.activated is False:
215
- self.notify = notify
216
- elif title is not None:
217
- self.title = title
218
- elif logging is not None:
219
- self.logging = logging
220
-
221
- if self.title in self._category_store:
222
- self._category_store[self.title]['activated'] = self.activated
223
- self._category_store[self.title]["title"] = self.title
224
- self._category_store[self.title]["logging"] = self.logging
225
-
226
- return self
227
-
228
- def __call__(self, text):
229
- if not isinstance(text, str):
230
- try:
231
- text = str(text)
232
- except Exception as e:
233
- text = f"Cannot convert to string format: {e}"
234
- self.info(text)
File without changes
File without changes
File without changes