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

Implement logging system #104

Open
HealthyPear opened this issue Feb 17, 2021 · 2 comments
Open

Implement logging system #104

HealthyPear opened this issue Feb 17, 2021 · 2 comments
Assignees
Milestone

Comments

@HealthyPear
Copy link
Member

Both supporting libraries (ctapipe and pyirf) already provide a logging system that makes use of python's logging facility.

Even after the refactoring, there will be the need for a better login system of the pipeline, and having it available already in 0.4.0-dev would be nice.

@HealthyPear HealthyPear added this to the v0.5.0 milestone Feb 17, 2021
@HealthyPear HealthyPear self-assigned this Feb 17, 2021
@kosack
Copy link
Contributor

kosack commented Feb 17, 2021

just remember that if you use ctapipe Components and Tools as base classes, you get logging for free. That is the final goal in protopipe, so do not spend much time implementing anything fancy in protopipe.

  1. make sure all output uses python's logging system (no print statements), using a separate logger for each file:
import logging
logger = logging.getLogger(__name__)

...

#later in code:
     logger.warning("this is bad")
  1. use the logging levels (info, debug, warning) correctly
  2. in any executable script you have now that does not use ctapipe's Tool/Component framework, add a line to set up the logger, like logging.defaultConfig(level=INFO) (don't worry too much about getting the format or making it user-configurable, that will come when you use ctapipe more).

A better goal would just be to convert protopipe scripts to use ctapipe.core.Tool, like what was recently done for lstchain

@HealthyPear
Copy link
Member Author

A better goal would just be to convert protopipe scripts to use ctapipe.core.Tool, like what was recently done for lstchain

this is part of the refactoring, but until it's completely done there are many prints here and there
of course what is already logged from ctapipe and pyirf shows up already when launching protopipe's scripts

@HealthyPear HealthyPear modified the milestones: v0.5.0, v0.6.0 Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants