Skip to content

Commit

Permalink
Merge pull request #82 from qua-platform/qualibrate-core-logging
Browse files Browse the repository at this point in the history
Config log folder
  • Loading branch information
nulinspiratie authored Sep 13, 2024
2 parents 48389ba + 469edff commit 8464130
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion backend/qualibrate_app/cli/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ def write_config(
if qss.project:
project_path = qss.storage.location / qss.project
project_path.mkdir(parents=True, exist_ok=True)
if qss.log_folder:
qss.log_folder.mkdir(parents=True, exist_ok=True)
if not config_file.parent.exists():
config_file.parent.mkdir(parents=True)
common_config[CONFIG_KEY] = qas_exported_data
Expand Down Expand Up @@ -213,7 +215,7 @@ def write_config(
resolve_path=True,
path_type=Path,
),
default=Path().home() / ".qualibrate" / "user_storage",
default=QUALIBRATE_PATH / "user_storage",
help="Path to user storage directory with qualibrate data.",
show_default=True,
)
Expand Down Expand Up @@ -260,6 +262,7 @@ def config_command(
overwrite: bool,
static_site_files: Path,
storage_type: StorageType,
log_path: Path,
user_storage: Path,
project: Optional[str],
metadata_out_path: str,
Expand Down
2 changes: 2 additions & 0 deletions backend/qualibrate_app/config/models/qualibrate.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from pathlib import Path
from typing import Optional

from pydantic import field_serializer
Expand All @@ -23,6 +24,7 @@ class QualibrateSettingsBase(BaseSettings, Versioned):

project: Optional[str]
storage: StorageSettingsBase
log_folder: Optional[Path] = None


class QualibrateSettingsSetup(QualibrateSettingsBase):
Expand Down
5 changes: 3 additions & 2 deletions backend/tests/api/local_storage/fixtures/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@ def settings_path_filled(settings: QualibrateAppSettings, settings_path: Path):
tomli_w.dump(
{
CONFIG_KEY: settings.model_dump(
exclude={"qualibrate"}, mode="json"
exclude={"qualibrate"}, mode="json", exclude_none=True
),
QUALIBRATE_CONFIG_KEY: settings.qualibrate.model_dump(
mode="json"
mode="json",
exclude_none=True,
),
},
fin,
Expand Down

0 comments on commit 8464130

Please sign in to comment.