Closed ianohara closed 3 weeks ago
I will rebase on #113 once (if) it lands. I can't select a pull request base that's not pushed to this fork, so can't get rid of that noise. Sorry :/
This adds logging tools in the
octopi.logging
module (along with theoctopi
package), and two helpers there for getting loggers and setting theoctopi
logger logging level. This allows us to have a dedicated hierarchy of loggers that we can configure while leaving all the loggers setup by other libraries alone.It also adds an example usage in the
control._def.py
module. We can start converting individual files after this.It also lays the groundwork for better crash reports by allowing us to hook up handlers for uncaught exceptions. By default these just print to console, but we want to be able to hook up a
FileHandler
to our logger and have the uncaught exceptions go there as well. Actually creating theFileHandler
and attaching it to the root octopi logger is to come.Tested by: Attempting to run
main_hcs.py
, and seeing log messages:I also added a random
raise ValueError("test test")
inmain_hcs.py
for a different run to make sure that the handlers work as expected:
@ianohara can you change octopi
to squid
?
This adds logging tools in the
octopi.logging
module (along with theoctopi
package), and two helpers there for getting loggers and setting theoctopi
logger logging level. This allows us to have a dedicated hierarchy of loggers that we can configure while leaving all the loggers setup by other libraries alone. It also adds an example usage in thecontrol._def.py
module. We can start converting individual files after this. It also lays the groundwork for better crash reports by allowing us to hook up handlers for uncaught exceptions. By default these just print to console, but we want to be able to hook up aFileHandler
to our logger and have the uncaught exceptions go there as well. Actually creating theFileHandler
and attaching it to the root octopi logger is to come. Tested by: Attempting to runmain_hcs.py
, and seeing log messages: I also added a randomraise ValueError("test test")
inmain_hcs.py
for a different run to make sure that the handlers work as expected:@ianohara can you change
octopi
tosquid
?
Yep, will do. Also I'll move this over to https://github.com/Cephla-Lab/Squid
This adds logging tools in the
octopi.logging
module (along with theoctopi
package), and two helpers there for getting loggers and setting theoctopi
logger logging level. This allows us to have a dedicated hierarchy of loggers that we can configure while leaving all the loggers setup by other libraries alone.It also adds an example usage in the
control._def.py
module. We can start converting individual files after this.It also lays the groundwork for better crash reports by allowing us to hook up handlers for uncaught exceptions. By default these just print to console, but we want to be able to hook up a
FileHandler
to our logger and have the uncaught exceptions go there as well. Actually creating theFileHandler
and attaching it to the root octopi logger is to come.Tested by: Attempting to run
main_hcs.py
, and seeing log messages:I also added a random
raise ValueError("test test")
inmain_hcs.py
for a different run to make sure that the handlers work as expected: