Skip to content

Standardize CLI logger names - #109

Merged
jlegrand62 merged 3 commits into
devfrom
hotfix/logger-name
Jul 29, 2026
Merged

jlegrand62 merged 3 commits into
devfrom
hotfix/logger-name

Conversation

@jlegrand62

Copy link
Copy Markdown
Member

Summary of changes

  • Refactored logger initialization in all FSDB CLI modules (fsdb_rest_api_sync.py, fsdb_healthcheck.py, fsdb_import_folder.py, fsdb_import_images.py, fsdb_import_file.py, shared_fsdb.py):
    • Defined ROMI_APP_LOGGER using __name__.split('.')[-1] to capture the module’s basename.
    • Created the logger with os.getenv('ROMI_APP_LOGGER') after the environment variable is set.
  • Ensured consistent logger naming across all CLI commands.

Others

  • Deleted the fsdb_healthcheck entry from plantdb/src/server/pyproject.toml as this is a CLI from plantdb.commons.

- In `fsdb_healthcheck.py`, set `ROMI_APP_LOGGER` using `__name__.split('.')[-1]` before creating the logger and instantiate `logger` with `os.getenv('ROMI_APP_LOGGER')`.
- Apply the same `ROMI_APP_LOGGER` naming change to `fsdb_import_folder.py`, `fsdb_import_images.py`, `fsdb_import_file.py`, and `shared_fsdb.py`.
- Ensure the environment variable is defined prior to logger creation for consistent logger names across all FSDB CLI commands.
- Set `ROMI_APP_LOGGER` using `__name__.split('.')[-1]` to capture the module’s basename.
- Ensure the logger is instantiated with the updated environment variable for consistent naming across FSDB CLI commands.
- Delete the `fsdb_healthcheck = "plantdb.comons.cli.fsdb_healthcheck:main"` line from `plantdb/src/server/pyproject.toml` to clean up unused script configuration.
@jlegrand62 jlegrand62 self-assigned this Jul 29, 2026
@jlegrand62
jlegrand62 merged commit 1ad57dd into dev Jul 29, 2026
1 check passed
@jlegrand62
jlegrand62 deleted the hotfix/logger-name branch July 29, 2026 15:07
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