Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add logging to Modflow 6 package #491

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Manangka opened this issue Dec 11, 2023 · 2 comments · Fixed by #917
Closed

Add logging to Modflow 6 package #491

Manangka opened this issue Dec 11, 2023 · 2 comments · Fixed by #917
Assignees
Labels

Comments

@Manangka
Copy link
Collaborator

Manangka commented Dec 11, 2023

In GitLab by @JoerivanEngelen on Jul 25, 2023, 17:41

Add logging to:

  • Initialization?
  • Writing
  • Dump
  • Validation?
@Manangka Manangka changed the title [PLACEHOLDER] - for issue #491 Add logging to Modflow 6 package Dec 12, 2023
@Manangka Manangka reopened this Dec 12, 2023
@JoerivanEngelen
Copy link
Contributor

JoerivanEngelen commented Mar 13, 2024

Example log messages:

Initialization

"Initializing the StructuredDiscretization package..."
"Succesfully initialized the StructuredDiscretization package"

Writing

"Writing model 'test_model' to /path/model/dir"... --> This will be for issue #492

"Writing the StructuredDiscretization package..."
"Succesfully wrote StructuredDiscretization package"

"Succesfully wrote model 'test_model' to /path/model/dir" --> This will be for issue #492

I think the nicest thing (potentially) for to do this kind of logging is to use decorators, to avoid code duplication.

As log levels: the "starting" logging message can be level "INFO", the ending one can be "DEBUG"

@github-project-automation github-project-automation bot moved this to 📯 New in iMOD Suite Mar 13, 2024
@JoerivanEngelen JoerivanEngelen moved this from 📯 New to 📝Refined in iMOD Suite Mar 13, 2024
@luitjansl luitjansl moved this from 📝Refined to 🏗 In Progress in iMOD Suite Mar 13, 2024
@luitjansl
Copy link
Contributor

Should the "run" method of the Simulation class have logging? (I would add it with urgency level "CRITICAL" so that it'll always show up.)

@luitjansl luitjansl mentioned this issue Mar 15, 2024
5 tasks
@luitjansl luitjansl moved this from 🏗 In Progress to 🧐 In Review in iMOD Suite Mar 15, 2024
github-merge-queue bot pushed a commit that referenced this issue Mar 19, 2024
Fixes #491

# Description
adds 2 decorators that will log a message before and after executing the
methods they are wrapping.


# Checklist
<!---
Before requesting review, please go through this checklist:
-->

- [X] Links to correct issue
- [X] Update changelog, if changes affect users
- [X] PR title starts with ``Issue #nr``, e.g. ``Issue #737``
- [X] Unit tests were added
- [ ] **If feature added**: Added/extended example

---------

Co-authored-by: Joeri van Engelen <[email protected]>
@github-project-automation github-project-automation bot moved this from 🧐 In Review to ✅ Done in iMOD Suite Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

3 participants