Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
pcrespov committed Apr 27, 2023
1 parent 1c1d351 commit 7aa068e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .env-devel
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ WEBSERVER_STUDIES_ACCESS_ENABLED=0
# For development ONLY ---------------
#
# AIODEBUG_SLOW_DURATION_SECS=0.25
# API_SERVER_HTTP_CALLS_CAPTURE_LOGS_PATH=captures.ignore.keep.log
# API_SERVER_DEV_HTTP_CALLS_LOGS_PATH=captures.ignore.keep.log
# PYTHONTRACEMALLOC=1
# PYTHONASYNCIODEBUG=1
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ class ApplicationSettings(BasicSettings):
API_SERVER_TRACING: TracingSettings | None = Field(auto_default_from_env=True)

# DEV-TOOLS
API_SERVER_HTTP_CALLS_CAPTURE_LOGS_PATH: Path | None = Field(
API_SERVER_DEV_HTTP_CALLS_LOGS_PATH: Path | None = Field(
default=None,
description="If set, it activates http calls capture mechanism used to generate mock data"
"Path to store captured client calls."
"TIP: use 'API_SERVER_HTTP_CALLS_CAPTURE_LOGS_PATH=captures.ignore.keep.log'"
"TIP: use 'API_SERVER_DEV_HTTP_CALLS_LOGS_PATH=captures.ignore.keep.log'"
"NOTE: only available in devel mode",
)

Expand All @@ -140,7 +140,7 @@ def debug(self) -> bool:
"""If True, debug tracebacks should be returned on errors."""
return self.SC_BOOT_MODE is not None and self.SC_BOOT_MODE.is_devel_mode()

@validator("API_SERVER_HTTP_CALLS_CAPTURE_LOGS_PATH")
@validator("API_SERVER_DEV_HTTP_CALLS_LOGS_PATH")
@classmethod
def _enable_only_in_devel_mode(cls, v, values):
if v and not (
Expand All @@ -149,7 +149,7 @@ def _enable_only_in_devel_mode(cls, v, values):
and boot_mode.is_devel_mode()
):
raise ValueError(
"API_SERVER_HTTP_CALLS_CAPTURE_LOGS_PATH only allowed in devel mode"
"API_SERVER_DEV_HTTP_CALLS_LOGS_PATH only allowed in devel mode"
)
return v

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def setup_client_instance(
with suppress(AttributeError):
# NOTE that this is a general function with no guarantees as when is going to be used.
# Here, 'AttributeError' might be raied when app.state.settings is still not initialized
if capture_path := app.state.settings.API_SERVER_HTTP_CALLS_CAPTURE_LOGS_PATH:
if capture_path := app.state.settings.API_SERVER_DEV_HTTP_CALLS_LOGS_PATH:
_setup_capture_logger_once(capture_path)
client_class = _AsyncClientForDevelopmentOnly

Expand Down

0 comments on commit 7aa068e

Please sign in to comment.