izihawa-loglib 1.1.12__tar.gz → 1.1.14__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: izihawa_loglib
3
- Version: 1.1.12
3
+ Version: 1.1.14
4
4
  Summary: Izihawa log utilities
5
5
  Author: Pasha Podolsky
6
6
  Author-email: ppodolsky@me.com
@@ -12,7 +12,7 @@ Classifier: Programming Language :: Python :: 3.11
12
12
  Classifier: Programming Language :: Python :: 3.12
13
13
  Requires-Dist: confuse (>=2.0.1,<3.0.0)
14
14
  Requires-Dist: izihawa-types (>=0.1.4,<0.2.0)
15
- Requires-Dist: izihawa-utils (>=1.2.1,<2.0.0)
15
+ Requires-Dist: izihawa-utils (>=1.2.2,<2.0.0)
16
16
  Requires-Dist: orjson (>=3.9.10,<4.0.0)
17
17
  Description-Content-Type: text/markdown
18
18
 
@@ -12,13 +12,18 @@ class RequestContext:
12
12
  self, **kwargs: dict[str, Any],
13
13
  ):
14
14
  self.default_fields = kwargs
15
- if "request_id" not in self.default_fields:
15
+ if not self.default_fields.get("request_id"):
16
16
  self.default_fields["request_id"] = RequestContext.generate_request_id(
17
17
  self.request_id_length
18
18
  )
19
19
 
20
20
  def __getattr__(self, name: str) -> Any:
21
- return self.default_fields[name]
21
+ try:
22
+ return self.default_fields[name]
23
+ except KeyError:
24
+ classname = type(self).__name__
25
+ msg = f'{classname!r} object has no attribute {name!r}'
26
+ raise AttributeError(msg)
22
27
 
23
28
  @staticmethod
24
29
  def generate_request_id(length):
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "izihawa_loglib"
3
- version = "1.1.12"
3
+ version = "1.1.14"
4
4
  description = "Izihawa log utilities"
5
5
  authors = ["Pasha Podolsky <ppodolsky@me.com>"]
6
6
  readme = "README.md"
@@ -11,7 +11,7 @@ packages = [{include = "izihawa_loglib"}]
11
11
  python = "^3.8.1"
12
12
  confuse = "^2.0.1"
13
13
  izihawa-types = "^0.1.4"
14
- izihawa-utils = "^1.2.1"
14
+ izihawa-utils = "^1.2.2"
15
15
  orjson = "^3.9.10"
16
16
 
17
17