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

Refactor: Logging/Reporting #117

Open
Tracked by #63
Klankers opened this issue Sep 3, 2024 · 2 comments
Open
Tracked by #63

Refactor: Logging/Reporting #117

Klankers opened this issue Sep 3, 2024 · 2 comments
Labels
cleanup enhancement New feature or request
Milestone

Comments

@Klankers
Copy link
Contributor

Klankers commented Sep 3, 2024

Consolidate all applicable functions, classes, modules (new and old) to some new tracking subset. This could include logging and reporting, handling performance and data statistics.

This was referenced Sep 3, 2024
@Klankers Klankers changed the title Logging/Reporting Refactor: Logging/Reporting Sep 3, 2024
@Klankers Klankers added enhancement New feature or request cleanup labels Sep 3, 2024
@Klankers Klankers added this to the ARC01 Cruise Completion milestone Sep 3, 2024
@Klankers
Copy link
Contributor Author

As discussed today:

  • reporting should be able to scrape ctdcal.log and get the details of the last run, or series of runs.
  • Python logging should only be initialized once, and from the same place. As such, it should be initialized from the logging module, rather than __main__.

@DocOtak
Copy link
Contributor

DocOtak commented Sep 23, 2024

Granted I wasn't at the actual meeting where this was talked about....

Could you clarify what you mean by logging should be initialized once? The built in python logging is separated into logging emitters and handlers. Logging emitters should be done by using the a logging. getLogger(__main__) call at the top of the each file that will emit log messages. Logging handlers should be initialized by whatever script is going to do something with the log messages. For a cli, then a __main__.py might be the right place or even inside a if __name__ == "__main__" guard. In general, you don't want your library code to have any log handlers, only log emitters.

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

No branches or pull requests

2 participants