digitalkin 0.2.24__py3-none-any.whl → 0.2.25rc1__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.
digitalkin/__version__.py CHANGED
@@ -5,4 +5,4 @@ from importlib.metadata import PackageNotFoundError, version
5
5
  try:
6
6
  __version__ = version("digitalkin")
7
7
  except PackageNotFoundError:
8
- __version__ = "0.2.24"
8
+ __version__ = "0.2.25rc1"
digitalkin/logger.py CHANGED
@@ -11,6 +11,15 @@ from typing import Any, ClassVar
11
11
  class ColorJSONFormatter(logging.Formatter):
12
12
  """Color JSON formatter for development (pretty-printed with colors)."""
13
13
 
14
+ def __init__(self, *, is_production: bool = False) -> None:
15
+ """Initialize the formatter.
16
+
17
+ Args:
18
+ is_production: Whether the application is running in production.
19
+ """
20
+ self.is_production = is_production
21
+ super().__init__()
22
+
14
23
  grey = "\x1b[38;20m"
15
24
  green = "\x1b[32;20m"
16
25
  blue = "\x1b[34;20m"
@@ -81,9 +90,11 @@ class ColorJSONFormatter(logging.Formatter):
81
90
 
82
91
  # Pretty print with color
83
92
  color = self.COLORS.get(record.levelno, self.grey)
93
+ if self.is_production:
94
+ log_obj["message"] = f"{color}{log_obj.get('message', '')}{self.reset}"
95
+ return json.dumps(log_obj, default=str, separators=(",", ":"))
84
96
  json_str = json.dumps(log_obj, indent=2, default=str)
85
- if not os.getenv("RAILWAY_SERVICE_NAME"):
86
- json_str.replace("\\n", "\n")
97
+ json_str = json_str.replace("\\n", "\n")
87
98
  return f"{color}{json_str}{self.reset}"
88
99
 
89
100
 
@@ -98,11 +109,12 @@ logging.getLogger("asyncio").setLevel(logging.DEBUG)
98
109
 
99
110
 
100
111
  logger = logging.getLogger("digitalkin")
112
+ is_production = os.getenv("RAILWAY_SERVICE_NAME") is not None
101
113
 
102
114
  if not logger.handlers:
103
115
  ch = logging.StreamHandler()
104
116
  ch.setLevel(logging.INFO)
105
- ch.setFormatter(ColorJSONFormatter())
117
+ ch.setFormatter(ColorJSONFormatter(is_production=is_production))
106
118
 
107
119
  logger.addHandler(ch)
108
120
  logger.propagate = False
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: digitalkin
3
- Version: 0.2.24
3
+ Version: 0.2.25rc1
4
4
  Summary: SDK to build kin used in DigitalKin
5
5
  Author-email: "DigitalKin.ai" <contact@digitalkin.ai>
6
6
  License: Attribution-NonCommercial-ShareAlike 4.0 International
@@ -7,8 +7,8 @@ base_server/mock/__init__.py,sha256=YZFT-F1l_TpvJYuIPX-7kTeE1CfOjhx9YmNRXVoi-jQ,
7
7
  base_server/mock/mock_pb2.py,sha256=sETakcS3PAAm4E-hTCV1jIVaQTPEAIoVVHupB8Z_k7Y,1843
8
8
  base_server/mock/mock_pb2_grpc.py,sha256=BbOT70H6q3laKgkHfOx1QdfmCS_HxCY4wCOX84YAdG4,3180
9
9
  digitalkin/__init__.py,sha256=7LLBAba0th-3SGqcpqFO-lopWdUkVLKzLZiMtB-mW3M,162
10
- digitalkin/__version__.py,sha256=doslC_UELPoDsQsRNB2BH7DPdcFLjp1QaMWzVWEl5Q0,191
11
- digitalkin/logger.py,sha256=9wYPKPOlw8l7S-R_QPeQwMFWKZ8c2W9dSjAxTxBDDfY,2893
10
+ digitalkin/__version__.py,sha256=KZi9ZQkxKd2YDA-Qa3bqyav332cxTAMLtGZ_lxmZkjU,194
11
+ digitalkin/logger.py,sha256=YLE5mxw-UsByx9xnCJi2-ZH6YQzhH5FvzB7bQSMk_hA,3405
12
12
  digitalkin/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  digitalkin/grpc_servers/__init__.py,sha256=0cJBlwipSmFdXkyH3T0i6OJ1WpAtNsZgYX7JaSnkbtg,804
14
14
  digitalkin/grpc_servers/_base_server.py,sha256=NXnnZPjJqUDWoumhEbb7EOEWB7d8XYwpQs-l97NTe4k,18647
@@ -76,14 +76,14 @@ digitalkin/utils/arg_parser.py,sha256=nvjI1pKDY1HfS0oGcMQPtdTQcggXLtpxXMbnMxNEKR
76
76
  digitalkin/utils/development_mode_action.py,sha256=TqRuAF_A7bDD4twRB4PnZcRoNeaiAnEdxM5kvy4aoaA,1511
77
77
  digitalkin/utils/llm_ready_schema.py,sha256=JjMug_lrQllqFoanaC091VgOqwAd-_YzcpqFlS7p778,2375
78
78
  digitalkin/utils/package_discover.py,sha256=3e9-6Vf3yAAv2VkHHVK4QVqHJBxQqg3d8uuDTsXph24,13471
79
- digitalkin-0.2.24.dist-info/licenses/LICENSE,sha256=Ies4HFv2r2hzDRakJYxk3Y60uDFLiG-orIgeTpstnIo,20327
79
+ digitalkin-0.2.25rc1.dist-info/licenses/LICENSE,sha256=Ies4HFv2r2hzDRakJYxk3Y60uDFLiG-orIgeTpstnIo,20327
80
80
  modules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
81
81
  modules/cpu_intensive_module.py,sha256=ejB9XPnFfA0uCuFUQbM3fy5UYfqqAlF36rv_P5Ri8ho,8363
82
82
  modules/minimal_llm_module.py,sha256=Ijld__ZnhzfLwpXD1XVkLZ7jyKZKyOFZczOpiPttJZc,11216
83
83
  modules/text_transform_module.py,sha256=bwPSnEUthZQyfLwcTLo52iAxItAoknkLh8Y3m5aywaY,7251
84
84
  services/filesystem_module.py,sha256=71Mcja8jCQqiqFHPdsIXplFIHTvgkxRhp0TRXuCfgkk,7430
85
85
  services/storage_module.py,sha256=ybTMqmvGaTrR8PqJ4FU0cwxaDjT36TskVrGoetTGmno,6955
86
- digitalkin-0.2.24.dist-info/METADATA,sha256=KWdE_LSZKL0Axbin4LzERpxEI37xZYQuicXZLidA4PU,30579
87
- digitalkin-0.2.24.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
88
- digitalkin-0.2.24.dist-info/top_level.txt,sha256=gcjqlyrZuLjIyxrOIavCQM_olpr6ND5kPKkZd2j0xGo,40
89
- digitalkin-0.2.24.dist-info/RECORD,,
86
+ digitalkin-0.2.25rc1.dist-info/METADATA,sha256=SsEwLKBZ4R4Q4WDX6XxFpLpRzwkStalIiq5rFz8MQF0,30582
87
+ digitalkin-0.2.25rc1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
88
+ digitalkin-0.2.25rc1.dist-info/top_level.txt,sha256=gcjqlyrZuLjIyxrOIavCQM_olpr6ND5kPKkZd2j0xGo,40
89
+ digitalkin-0.2.25rc1.dist-info/RECORD,,