On 10/13/10 01:14 PM, Karen Tung wrote:
 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.

Whether or not we want to use overwrite the file if it's already there, I don't think the existence or absence of a file is a good way to determine whether or not to determine if we should create a default handler.

Since we open in "append" mode, and have control over the default location, AND add the pid, I think it's probably best to simply remove the check.

- Keith
_______________________________________________
caiman-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/caiman-discuss

Reply via email to