Skip to content

Refine logger naming - #107

Merged
jlegrand62 merged 2 commits into
devfrom
hotfix/cli-logger-name
Jul 27, 2026
Merged

jlegrand62 merged 2 commits into
devfrom
hotfix/cli-logger-name

Conversation

@jlegrand62

Copy link
Copy Markdown
Member
  • Modified logger initialization across several CLI modules to use __name__ (or its components) rather than __file__, ensuring logger names match the module names for consistency.
  • Updated REST API test examples to import API_PREFIX and test_database, create a temporary test database, and build request URLs using the prefix instead of hard‑coded paths.
  • Adjusted example usage comments to reflect new imports and URL construction.

- Updated logger initialization in `src/server/plantdb/server/cli/fsdb_rest_api.py` to use `__name__.split('.')[-1]`.
- Changed logger setup in the following CLI modules to use `__name__.split('.')[0]`:
  - `src/commons/plantdb/commons/cli/fsdb_import_folder.py`
  - `src/commons/plantdb/commons/cli/fsdb_import_images.py`
  - `src/commons/plantdb/commons/cli/fsdb_import_file.py`
  - `src/client/plantdb/client/cli/fsdb_rest_api_sync.py`
  - `src/commons/plantdb/commons/cli/shared_fsdb.py`
- Ensures logger names reflect the module name, improving consistency across the codebase.
…t database

- Import `test_database` from `plantdb.commons.test_database` in `src/server/plantdb/server/test_rest_api.py`
- Import `API_PREFIX` from `plantdb.server.test_rest_api`
- Create a test database with `test_database(dataset=None)` before starting the API
- Construct request URLs using `f"{api.get_base_url()}/{API_PREFIX}/scans"` instead of the hard‑coded `/scans` path
- Adjust example usage comments to reflect the new imports and URL construction.
@jlegrand62 jlegrand62 self-assigned this Jul 26, 2026
@jlegrand62
jlegrand62 merged commit d027658 into dev Jul 27, 2026
1 check passed
@jlegrand62
jlegrand62 deleted the hotfix/cli-logger-name branch July 27, 2026 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants