Skip to content
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

Model.logger not available #1080

Closed
2 tasks done
veenstrajelmer opened this issue Sep 30, 2024 · 2 comments
Closed
2 tasks done

Model.logger not available #1080

veenstrajelmer opened this issue Sep 30, 2024 · 2 comments
Labels
Bug Something isn't working Needs refinement issue still needs refinement

Comments

@veenstrajelmer
Copy link
Collaborator

HydroMT version checks

  • I have checked that this issue has not already been reported.
  • I have checked that this bug exists on the latest version of HydroMT.

Reproducible Example

The code below raises KeyError: 'logger'

from hydromt.model import Model
mod = Model()
mod.logger

Current behaviour

KeyError: 'logger'

Desired behaviour

I think I read here it should now be a new property of Model:
https://github.com/Deltares/hydromt/blob/main/docs/guides/plugin_dev/migrating_to_v1.rst#logging

Additional context

No response

@veenstrajelmer veenstrajelmer added Bug Something isn't working Needs refinement issue still needs refinement labels Sep 30, 2024
@savente93
Copy link
Contributor

Under the header changes required it states this:

Remove the logger keywords from your HydroMT functions, methods and classes. If you want to influence HydroMT logging, change the "hydromt" logger: logger = logging.getLogger("hydromt").

once you use the built in logging.getLogger function you should be able to use the logger as you'd be used to

@veenstrajelmer
Copy link
Collaborator Author

Sorry, indeed I misread. I have updated the hydromt_delft3dfm PR accordingly. I will close this issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Needs refinement issue still needs refinement
Projects
None yet
Development

No branches or pull requests

2 participants