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

Use 'logging' instead of 'print' statements #18

Open
pr4deepr opened this issue Sep 27, 2022 · 3 comments
Open

Use 'logging' instead of 'print' statements #18

pr4deepr opened this issue Sep 27, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@pr4deepr
Copy link
Collaborator

No description provided.

@pr4deepr pr4deepr added the enhancement New feature or request label Sep 27, 2022
@GenevieveBuckley
Copy link

You know, I gave an extremely short talk about logging at PyConAU a few years ago. That repository with example scripts is still up: https://github.com/GenevieveBuckley/pyconau-2019-talk

I remember it was sightly difficult for me to figure out how you could log the entire traceback of any uncaught exceptions (useful for unexpected crashes), which is in example3.py. That may or may not be helpful here too.

@pr4deepr
Copy link
Collaborator Author

Thanks a lot @GenevieveBuckley .
I really liked the presentation and reference to "lumberjack" 🤣 . Quite engaging talk too!

So, I did start implementing logging.
But, from your talk I learnt you can different log levels at terminal and file... Didn't realise that.

Worth implementing that and having a full stack trace saved in the data processing folder.

Currently, this is how I've done it
https://github.com/BioimageAnalysisCoreWEHI/napari_lattice/blob/master/src/napari_lattice/__init__.py

Adding it to list of TODO:
https://github.com/orgs/BioimageAnalysisCoreWEHI/projects/2/views/1?pane=issue&itemId=24299088

@GenevieveBuckley
Copy link

Fingers crossed it'll be as simple as doing a find and replace on all the print statements.

Although I guess now you have the ability to categorize things into categories (debug/warning/error/critical), that might need a person to double check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants