bear-utils 0.8.14__py3-none-any.whl → 0.8.16__py3-none-any.whl
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.
- bear_utils/extras/responses/function_response.py +6 -3
- bear_utils/logger_manager/__init__.py +2 -1
- bear_utils/logger_manager/logger_protocol.py +21 -0
- {bear_utils-0.8.14.dist-info → bear_utils-0.8.16.dist-info}/METADATA +2 -2
- {bear_utils-0.8.14.dist-info → bear_utils-0.8.16.dist-info}/RECORD +6 -6
- {bear_utils-0.8.14.dist-info → bear_utils-0.8.16.dist-info}/WHEEL +0 -0
@@ -10,8 +10,9 @@ from typing import Any, Literal, Self, overload
|
|
10
10
|
|
11
11
|
from pydantic import BaseModel, Field, field_validator
|
12
12
|
|
13
|
-
from bear_utils.logger_manager
|
14
|
-
|
13
|
+
from bear_utils.logger_manager import (
|
14
|
+
AsyncLoggerProtocol, # noqa: TC001
|
15
|
+
LoggerProtocol, # noqa: TC001
|
15
16
|
)
|
16
17
|
|
17
18
|
SUCCESS: list[str] = ["name", "success"]
|
@@ -28,7 +29,9 @@ class FunctionResponse(BaseModel):
|
|
28
29
|
error: list[str] = Field(default=[], description="Error message if the function call failed")
|
29
30
|
sub_tasks: list[FunctionResponse] = Field(default_factory=list, description="List of sub-tasks.")
|
30
31
|
number_of_tasks: int = Field(default=0, description="Number of tasks processed in this response.")
|
31
|
-
logger: LoggerProtocol | None = Field(
|
32
|
+
logger: LoggerProtocol | AsyncLoggerProtocol | None = Field(
|
33
|
+
default=None, description="Logger instance for logging messages."
|
34
|
+
)
|
32
35
|
attrs: Namespace = Field(default_factory=Namespace, description="Storing additional attributes dynamically.")
|
33
36
|
|
34
37
|
model_config = {
|
@@ -4,7 +4,7 @@ from typing import Any
|
|
4
4
|
|
5
5
|
from bear_utils.logger_manager._common import VERBOSE_CONSOLE_FORMAT
|
6
6
|
from bear_utils.logger_manager._styles import VERBOSE
|
7
|
-
from bear_utils.logger_manager.logger_protocol import LoggerProtocol
|
7
|
+
from bear_utils.logger_manager.logger_protocol import AsyncLoggerProtocol, LoggerProtocol
|
8
8
|
from bear_utils.logger_manager.loggers.base_logger import BaseLogger
|
9
9
|
from bear_utils.logger_manager.loggers.buffer_logger import BufferLogger
|
10
10
|
from bear_utils.logger_manager.loggers.console_logger import ConsoleLogger
|
@@ -82,6 +82,7 @@ def get_sub_logger(
|
|
82
82
|
__all__ = [
|
83
83
|
"VERBOSE",
|
84
84
|
"VERBOSE_CONSOLE_FORMAT",
|
85
|
+
"AsyncLoggerProtocol",
|
85
86
|
"BaseLogger",
|
86
87
|
"BufferLogger",
|
87
88
|
"ConsoleLogger",
|
@@ -22,3 +22,24 @@ class LoggerProtocol(Protocol):
|
|
22
22
|
def error(self, msg: object, *args, **kwargs) -> None:
|
23
23
|
"""Log an error message."""
|
24
24
|
...
|
25
|
+
|
26
|
+
|
27
|
+
@runtime_checkable
|
28
|
+
class AsyncLoggerProtocol(Protocol):
|
29
|
+
"""A protocol for asynchronous logging classes."""
|
30
|
+
|
31
|
+
async def debug(self, msg: object, *args, **kwargs) -> None:
|
32
|
+
"""Log a debug message asynchronously."""
|
33
|
+
...
|
34
|
+
|
35
|
+
async def info(self, msg: object, *args, **kwargs) -> None:
|
36
|
+
"""Log an info message asynchronously."""
|
37
|
+
...
|
38
|
+
|
39
|
+
async def warning(self, msg: object, *args, **kwargs) -> None:
|
40
|
+
"""Log a warning message asynchronously."""
|
41
|
+
...
|
42
|
+
|
43
|
+
async def error(self, msg: object, *args, **kwargs) -> None:
|
44
|
+
"""Log an error message asynchronously."""
|
45
|
+
...
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: bear-utils
|
3
|
-
Version: 0.8.
|
3
|
+
Version: 0.8.16
|
4
4
|
Summary: Various utilities for Bear programmers, including a rich logging utility, a disk cache, and a SQLite database wrapper amongst other things.
|
5
5
|
Author-email: chaz <bright.lid5647@fastmail.com>
|
6
6
|
Requires-Python: >=3.12
|
@@ -22,7 +22,7 @@ Requires-Dist: toml>=0.10.2
|
|
22
22
|
Requires-Dist: uvicorn>=0.35.0
|
23
23
|
Description-Content-Type: text/markdown
|
24
24
|
|
25
|
-
# Bear Utils v# Bear Utils v0.8.
|
25
|
+
# Bear Utils v# Bear Utils v0.8.16
|
26
26
|
|
27
27
|
Personal set of tools and utilities for Python projects, focusing on modularity and ease of use. This library includes components for caching, database management, logging, time handling, file operations, CLI prompts, image processing, clipboard interaction, gradient utilities, event systems, and async helpers.
|
28
28
|
|
@@ -37,7 +37,7 @@ bear_utils/extras/_async_helpers.py,sha256=cxq5d24NHkECmZqTVXEazv6K-XUa7skFnX6KQ
|
|
37
37
|
bear_utils/extras/_tools.py,sha256=-rOH_-0pRd7_-o_l2QqByYBB2yhbXcTC8fuQf4Sx-eg,7671
|
38
38
|
bear_utils/extras/platform_utils.py,sha256=Ai7ow7S-_cKb5zFwFh8dkC8xmbMJFy-0_-w3NCERdEw,1362
|
39
39
|
bear_utils/extras/responses/__init__.py,sha256=XbE4VKemrKRwx9E5jqy__OiM_AAjA58ebnqQ2hytnT0,225
|
40
|
-
bear_utils/extras/responses/function_response.py,sha256=
|
40
|
+
bear_utils/extras/responses/function_response.py,sha256=P-z6rGF2hcLYCdyDXBQD-0rVtUdIciqTJU2vaQEEyes,15219
|
41
41
|
bear_utils/extras/wrappers/__init__.py,sha256=crh4sKOLvuhNMVX5bJYjCFWtXtH7G47UgNPOHq3HXTk,43
|
42
42
|
bear_utils/extras/wrappers/add_methods.py,sha256=z2XZG2ZoYOB1MaGiLli4NRyyTeRgBy7tuYsiy8mTa9s,4422
|
43
43
|
bear_utils/files/__init__.py,sha256=mIdnFSXoDE64ElM43bN2m6KuafURnN82ki0pdqN8q2o,201
|
@@ -61,12 +61,12 @@ bear_utils/gui/gui_tools/qt_app.py,sha256=hjZtHNJkCcpfT_KkUV35aa9y92ejEhpAV3AFgd
|
|
61
61
|
bear_utils/gui/gui_tools/qt_color_picker.py,sha256=5NtLiBHk5r9Goma_oiymriH49D_JGIk844p4Hsi51io,4744
|
62
62
|
bear_utils/gui/gui_tools/qt_file_handler.py,sha256=FgWdS-9WnjVuyGIC8V30ByDCBeJGZKGc8KRTy34SFfI,4404
|
63
63
|
bear_utils/gui/gui_tools/qt_input_dialog.py,sha256=5KaCM9q8kmoy-Fd0j1FbXIVrLlE7W47NEGdhsWtvKwQ,9281
|
64
|
-
bear_utils/logger_manager/__init__.py,sha256=
|
64
|
+
bear_utils/logger_manager/__init__.py,sha256=ARcTVgJE0BS0YLhnx9336mReH2lLeAaN-3KDX0i_t4k,3501
|
65
65
|
bear_utils/logger_manager/_common.py,sha256=kPTE4e0FKI8IBW1B5X7jJPVJtqgJtKYsX8gy8obg9OQ,1866
|
66
66
|
bear_utils/logger_manager/_console_junk.py,sha256=2fwiYjZZps3GrH5An7aU3Bgvb_aAJiqNzTnKaku6m-0,4916
|
67
67
|
bear_utils/logger_manager/_log_level.py,sha256=DBTOQdETazx9jK5rrvsjlEr96ciuB0A1q5GjzKp4UFA,4200
|
68
68
|
bear_utils/logger_manager/_styles.py,sha256=1mYHnENhLUWHB2QSpT9CB3_dzgBjhBxM1sh5UGEUULU,2527
|
69
|
-
bear_utils/logger_manager/logger_protocol.py,sha256=
|
69
|
+
bear_utils/logger_manager/logger_protocol.py,sha256=sEXrkFdcbJrMS2EqunNxO5osvgfdpmo9MTzAINDEqgg,1258
|
70
70
|
bear_utils/logger_manager/loggers/__init__.py,sha256=ashcnkvQIUQDLbUtU6QILkMjP_fMaeHAN1w7pHLWqQk,67
|
71
71
|
bear_utils/logger_manager/loggers/_level_sin.py,sha256=xykZNZKeHw9UH2ng3UAWgwgzPzA5JIkfkXJQGatsXcI,1868
|
72
72
|
bear_utils/logger_manager/loggers/base_logger.py,sha256=VNb_zj450qdvZ6oVsdPxQ7nwoAW9uOf2Jaaiw0msoVQ,9981
|
@@ -86,6 +86,6 @@ bear_utils/monitoring/__init__.py,sha256=9DKNIWTp_voLnaWgiP-wJ-o_N0hYixo-MzjUmg8
|
|
86
86
|
bear_utils/monitoring/_common.py,sha256=LYQFxgTP9fk0cH71IQTuGwBYYPWCqHP_mMRNecoD76M,657
|
87
87
|
bear_utils/monitoring/host_monitor.py,sha256=e0TYRJw9iDj5Ga6y3ck1TBFEeH42Cax5mQYaNU8yams,13241
|
88
88
|
bear_utils/time/__init__.py,sha256=VctjJG17SyEHAFXytI1sZrOrq7zm3hVenIDOJFdaMN0,1424
|
89
|
-
bear_utils-0.8.
|
90
|
-
bear_utils-0.8.
|
91
|
-
bear_utils-0.8.
|
89
|
+
bear_utils-0.8.16.dist-info/METADATA,sha256=bePdsq5iTT2qdge3-3ffr8ofkUj1MyyoC14Aoqy1rN0,8699
|
90
|
+
bear_utils-0.8.16.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
91
|
+
bear_utils-0.8.16.dist-info/RECORD,,
|
File without changes
|