On 10/13/10 06:00, Dermot McCluskey wrote:
parser.py: lines 145-148. Since this is the entry point when
invoked from the engine, shouldn't simply using self.logger
work? FWIW, the DC checkpoints used to do something like what
you have here but we changed it to simply use self.logger and
that works just as well.
I agree with Alok that MP/MW should use self.logger to log messages.
That will allow messages to be "tagged" correctly with the MP/MW
checkpoint name.
When I try that and re-run all my unit tests, only the output from one
of the
24 tests is in the log - all the other logging output is missing. Any
idea
what's going on here?
I've also noticed that even without making this change, some (but not
all)
of the output from my full set of unit tests is missing from the log.
It seems
that tests that use the InstallEngine are not logging, *if* those
tests are run
after some other tests that log output.
I looked at the log files in /var/tmp/install from running the engine tests,
and I also noticed that only log outputs from one of the tests show up.
Log output from other tests are missing.
I did some digging around, and I think it is caused by the following
code in usr/src/lib/install_logging_pymod/logger.py:
197 # Create the default log
198 # if not os.path.exists(DEFAULTLOG):
199 # filehdlr = FileHandler(filename=DEFAULTLOG, mode='a')
200 # filehdlr.setLevel(DEFAULTLOGLEVEL)
201 # filehdlr.setFormatter(InstallFormatter())
202 # logging.Logger.addHandler(self, filehdlr)
203 # filehdlr.addFilter(self._prog_filter)
204
205 filehdlr = FileHandler(filename=DEFAULTLOG, mode='a')
206 filehdlr.setLevel(DEFAULTLOGLEVEL)
207 filehdlr.setFormatter(InstallFormatter())
208 logging.Logger.addHandler(self, filehdlr)
209 filehdlr.addFilter(self._prog_filter)
Just for experiment, I commented out the original code block, and removed
the "if" statement. With that change, I get log output from all the
tests. Since the name of DEFAULTLOG
is based on pid, and different tests cases are running under the same
pid, the default
file handler is not added except for the 1st test case.
I am not sure simply removing the check is the right thing to do. We
might not
want to overwrite an existing file.
Do you have any examples where you have run more than one unit test
file, with more than one test per file, where all the tests log
something?
It would be very helpful to have a template of how to initialize and
reset
logging, in Engine checkpoints, non-Engine code, and unit tests. Do you
know if such examples exist?
parser.py: line 229: What use case does the cancel_requested
handle?
I'm not sure if I understand the question correctly, but this will be
invoked
in the user requested Cancel since the previous check, ie during the call
to _load_manifest(). I think Karen specifically requested I add this one
during her review.
I requested Dermot to add the check, because I _load_manifest()
could be a relative long operation, depending on the size of the manifest
to load. So, it would be good to check whether user requested cancel.
Thanks,
--Karen
_______________________________________________
caiman-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/caiman-discuss