Skip to content

Conversation

@j-atkins
Copy link
Collaborator

Relates to bug identified in #155

I've had a quick go at a bit of a hack to avoid the log being flooded with writing-to-file messages for every execution of adcp and underwater measurements. As I say it's a bit of a hack but it avoids having to change anything in Parcels, rather it simply prevents duplicate messages from being printed when running virtualship (but only for the adcp and underwater instruments and then it's switched off again).

The way I've written it means the log filter is applied by default for adcp and underwater instruments, but there is an option to switch it off in simulate_measurements.py by setting log_filter to False in simulate_adcp/simulate_ship_underwater_st.

Also, not sure if it's a bit messy to have log_filter.py sitting in src/virtualship/, is there somewhere better to house it?

@erikvansebille @VeckoTheGecko @ammedd what do you think?

@erikvansebille
Copy link
Member

Thanks for implementing this, @j-atkins. I agree that adding a filter to avoid many duplicate messages is good, but I leave it to @VeckoTheGecko to see if this is the most effective/cleanest way to implement it

@VeckoTheGecko
Copy link
Collaborator

I was talking with Jamie about this yesterday during our 1on1, and settled that it would be nice to suppress the Parcels messages here and to propogate our own. It will be cleaner - and decouples this from Parcels dev

@j-atkins
Copy link
Collaborator Author

Thanks both! I will need to make some changes to my original PR to instead suppress all Parcels messages (not just duplicates) and propagate our own. I'll put this on my to do list.

@j-atkins j-atkins closed this May 20, 2025
@j-atkins j-atkins mentioned this pull request May 20, 2025
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.

4 participants