fix: logger config and env file loading (#4174)
* fix: logger config and env file loading * fix: mypy error assignment and arg-type
This commit is contained in:
parent
f0eb7b50a6
commit
48148f0df6
2 changed files with 7 additions and 4 deletions
|
|
@ -149,13 +149,12 @@ def run(
|
||||||
),
|
),
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Run Langflow."""
|
"""Run Langflow."""
|
||||||
configure(log_level=log_level, log_file=log_file)
|
|
||||||
set_var_for_macos_issue()
|
|
||||||
|
|
||||||
if env_file:
|
if env_file:
|
||||||
load_dotenv(env_file, override=True)
|
load_dotenv(env_file, override=True)
|
||||||
logger.debug(f"Loading config from file: '{env_file}'")
|
|
||||||
|
|
||||||
|
configure(log_level=log_level, log_file=log_file)
|
||||||
|
logger.debug(f"Loading config from file: '{env_file}'" if env_file else "No env_file provided.")
|
||||||
|
set_var_for_macos_issue()
|
||||||
settings_service = get_settings_service()
|
settings_service = get_settings_service()
|
||||||
|
|
||||||
frame = inspect.currentframe()
|
frame = inspect.currentframe()
|
||||||
|
|
|
||||||
|
|
@ -150,6 +150,10 @@ def configure(
|
||||||
if log_level is None:
|
if log_level is None:
|
||||||
log_level = "ERROR"
|
log_level = "ERROR"
|
||||||
|
|
||||||
|
if log_file is None:
|
||||||
|
env_log_file = os.getenv("LANGFLOW_LOG_FILE", "")
|
||||||
|
log_file = Path(env_log_file) if env_log_file else None
|
||||||
|
|
||||||
if log_env is None:
|
if log_env is None:
|
||||||
log_env = os.getenv("LANGFLOW_LOG_ENV", "")
|
log_env = os.getenv("LANGFLOW_LOG_ENV", "")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue