Skip to content

Commit 0df12c1

Browse files
authored
Merge pull request #159 from ecmwf-projects/more-logs-on-init-db
more logs on init-db
2 parents 130a75c + 9e4d0b4 commit 0df12c1

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

cads_broker/entry_points.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,11 +297,14 @@ def init_db(connection_string: Optional[str] = None, force: bool = False) -> Non
297297
connection_string: something like 'postgresql://user:password@netloc:port/dbname'
298298
force: if True, drop the database structure and build again from scratch
299299
"""
300+
database.logger.info(
301+
"starting creation/updating of broker db structure and storage cache area."
302+
)
300303
if not connection_string:
301304
dbsettings = config.ensure_settings(config.dbsettings)
302305
connection_string = dbsettings.connection_string
303306
database.init_database(connection_string, force=force)
304-
print("successfully created/updated the broker database structure.")
307+
database.logger.info("successfully created/updated the broker database structure.")
305308

306309
# get storage parameters from environment
307310
for key in ("OBJECT_STORAGE_URL", "STORAGE_ADMIN", "STORAGE_PASSWORD"):
@@ -322,7 +325,10 @@ def init_db(connection_string: Optional[str] = None, force: bool = False) -> Non
322325
object_storage.create_download_bucket(
323326
download_bucket, object_storage_url, **storage_kws
324327
)
325-
print("successfully created the cache areas in the object storage.")
328+
database.logger.info("successfully created the cache areas in the object storage.")
329+
database.logger.info(
330+
"end of creation/updating of broker db structure and storage cache area."
331+
)
326332

327333

328334
@app.command()

0 commit comments

Comments
 (0)