rustprooflabs / pgosm-flex

PgOSM Flex provides high quality OpenStreetMap datasets in PostGIS (Postgres) using the osm2pgsql Flex output.
MIT License
101 stars 20 forks source link

Add DB Connection information to initial output #335

Closed rustprooflabs closed 1 year ago

rustprooflabs commented 1 year ago

Details

Now that I'm using --force in development, I'd really a reassurance that I'm really waiting on a Dev connection and not accidentally a prod one.

This line explains it's an external connection (only time I really care):

2023-05-31 20:08:08,043:INFO:pgosm-flex:db:Using external database. Ensure the target database is setup properly with proper permissions.

Maybe extend the line with

... with proper permissions for user "<user>" on host "<host>:<port>" in database "<dbname>"
rustprooflabs commented 1 year ago

336 adds the new log details when waiting on pg_isready, earlier than mentioned above. Putting the output here gives the user time to cancel the run. Putting the log later doesn't give the user any time to react.

External connection example with the lines before and after.

2023-06-02 19:48:01,536:INFO:pgosm-flex:db:Checking for Postgres service to be available
2023-06-02 19:48:01,536:INFO:pgosm-flex:db:Connecting to Postgres using role "pgosm_flex" on host  "172.16.0.170:5432"  in database "pgosm_dev"
2023-06-02 19:48:07,668:INFO:pgosm-flex:db:Postgres instance ready

Internal example (only the new line)

2023-06-02 19:56:43,147:INFO:pgosm-flex:db:Connecting to Postgres using role "postgres" on host  "localhost:5432"  in database "pgosm"