prediction-market-agent-tooling 0.45.0__py3-none-any.whl → 0.45.1__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.
@@ -31,6 +31,11 @@ class LogConfig(BaseSettings):
31
31
  LOG_LEVEL: LogLevel = LogLevel.DEBUG
32
32
 
33
33
 
34
+ class NoNewLineStreamHandler(logging.StreamHandler): # type: ignore # StreamHandler is not typed in the standard library.
35
+ def format(self, record: logging.LogRecord) -> str:
36
+ return super().format(record).replace("\n", " ")
37
+
38
+
34
39
  GCP_LOG_LOGURU_FORMAT = (
35
40
  "{level:<.1}{time:MMDD HH:mm:ss} {process} {name}:{line}] {message}"
36
41
  )
@@ -40,6 +45,10 @@ GCP_LOG_LOGGING_FORMAT, GCP_LOG_FORMAT_LOGGING_DATEFMT = (
40
45
 
41
46
 
42
47
  def patch_logger() -> None:
48
+ """
49
+ Function to patch loggers according to the deployed environment.
50
+ Patches Loguru's logger, Python's default logger, warnings library and also monkey-patch print function as many libraries just use it.
51
+ """
43
52
  config = LogConfig()
44
53
 
45
54
  if config.LOG_FORMAT == LogFormat.GCP:
@@ -47,10 +56,12 @@ def patch_logger() -> None:
47
56
  format_logging = GCP_LOG_LOGGING_FORMAT
48
57
  datefmt_logging = GCP_LOG_FORMAT_LOGGING_DATEFMT
49
58
  print_logging = print_using_loguru_info
59
+ handlers = [NoNewLineStreamHandler()]
50
60
 
51
61
  elif config.LOG_FORMAT == LogFormat.DEFAULT:
52
62
  format_loguru, format_logging, datefmt_logging = None, None, None
53
63
  print_logging = None
64
+ handlers = None
54
65
 
55
66
  else:
56
67
  raise ValueError(f"Unknown log format: {config.LOG_FORMAT}")
@@ -58,7 +69,10 @@ def patch_logger() -> None:
58
69
  # Change built-in logging.
59
70
  if format_logging is not None:
60
71
  logging.basicConfig(
61
- level=config.LOG_LEVEL.value, format=format_logging, datefmt=datefmt_logging
72
+ level=config.LOG_LEVEL.value,
73
+ format=format_logging,
74
+ datefmt=datefmt_logging,
75
+ handlers=handlers,
62
76
  )
63
77
 
64
78
  # Change loguru.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: prediction-market-agent-tooling
3
- Version: 0.45.0
3
+ Version: 0.45.1
4
4
  Summary: Tools to benchmark, deploy and monitor prediction market agents.
5
5
  Author: Gnosis
6
6
  Requires-Python: >=3.10,<3.12
@@ -22,7 +22,7 @@ prediction_market_agent_tooling/deploy/gcp/deploy.py,sha256=CYUgnfy-9XVk04kkxA_5
22
22
  prediction_market_agent_tooling/deploy/gcp/kubernetes_models.py,sha256=qYIHRxQLac3yxtZ8ChikiPG9O1aUQucHW0muTSm1nto,2627
23
23
  prediction_market_agent_tooling/deploy/gcp/utils.py,sha256=oyW0jgrUT2Tr49c7GlpcMsYNQjoCSOcWis3q-MmVAhU,6089
24
24
  prediction_market_agent_tooling/gtypes.py,sha256=ezM2iAycTRJ0uHKK03s0z76a8YFSF438kjOwT_BAqz4,2474
25
- prediction_market_agent_tooling/loggers.py,sha256=ua9rynYmsbOJZjxPIFxRBooomeN08zuLSJ7lxZMDS7w,3133
25
+ prediction_market_agent_tooling/loggers.py,sha256=JiBTgvb34O9dKHYKZyQ0UzojPUy6KSFQSTfbBIXopSY,3721
26
26
  prediction_market_agent_tooling/markets/agent_market.py,sha256=BELq6x3F4xLZwi0XmoN84RA7ttRQIclyHL2CY6a4Ixc,8409
27
27
  prediction_market_agent_tooling/markets/categorize.py,sha256=HyKSFHXPL7Hfe90ahbF7xszamYREUVrPkLcpifw1V9Y,935
28
28
  prediction_market_agent_tooling/markets/data_models.py,sha256=qD0LyFkzimaMkDVE0QO2a4I9fQ8qpO2qPmVzb-0JBik,2085
@@ -75,8 +75,8 @@ prediction_market_agent_tooling/tools/singleton.py,sha256=CiIELUiI-OeS7U7eeHEt0r
75
75
  prediction_market_agent_tooling/tools/streamlit_user_login.py,sha256=NXEqfjT9Lc9QtliwSGRASIz1opjQ7Btme43H4qJbzgE,3010
76
76
  prediction_market_agent_tooling/tools/utils.py,sha256=JE9YWtPPhnTgLiOyGAZDNG5K8nCwUY9IZEuAlm9UcxA,6611
77
77
  prediction_market_agent_tooling/tools/web3_utils.py,sha256=nKRHmdLnWSKd3wpo-cysXGvhhrJ2Yf69sN2FFQfSt6s,10578
78
- prediction_market_agent_tooling-0.45.0.dist-info/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
79
- prediction_market_agent_tooling-0.45.0.dist-info/METADATA,sha256=3KvBa071FaBwX1gQtAtG5rg9LMVEhIfSkZC5VrzYRcc,7634
80
- prediction_market_agent_tooling-0.45.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
81
- prediction_market_agent_tooling-0.45.0.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
82
- prediction_market_agent_tooling-0.45.0.dist-info/RECORD,,
78
+ prediction_market_agent_tooling-0.45.1.dist-info/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
79
+ prediction_market_agent_tooling-0.45.1.dist-info/METADATA,sha256=cuop8gl4vJj_cojxAvKj9nQX4tDKPhxjIuahsc1CCX0,7634
80
+ prediction_market_agent_tooling-0.45.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
81
+ prediction_market_agent_tooling-0.45.1.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
82
+ prediction_market_agent_tooling-0.45.1.dist-info/RECORD,,