On 10/15/10 11:02 AM, Karen Tung wrote:
 On 10/15/10 08:28 AM, Keith Mitchell wrote:
 On 10/14/10 04:46 PM, Ginnie Wray wrote:



2. I would like to change the logger.py code to check to see if the InstallLogger.ENGINE param is set. If not, execute the default FileHandler creation. If it is, skip it. This solves the double output issue. Instead of the check to see if the log path exists, I'll add a check for the following:

   if self.ENGINE is None:
       add filehandler code

What if instead, the Engine were in charge of configuring the default file handler? I think that might more cleanly solve the problem, and it also allows the logging code to be more agnostic to the execution environment.

This might also mean that (1) from above wouldn't be necessary (though I haven't tried it).


Having the engine be in charge of configuring the default file handler will solve the problem at hand. However, if I remember correctly, one of the design goal of the InstallLogger is that it will
automatically setup a default file handler.

If that's the case, then perhaps there needs to be a more explicit call to configure the default handler, since doing it implicitly and automatically is causing issues. Yes, the issues are currently in test code - but at least some of these problems seem like they'd occur if an app used the InstallLogger without the engine.

Otherwise, it's not easy to create a logging setup that *doesn't* use the default log, which is theoretically feasible.

  That way, users of InstallLogger don't have to
figure out how to setup a file handler if they don't want to.
Since InstallLogger can be used outside of the engine, I don't think having
the engine configure the default file handler is a good idea.

Yeah, I agree now that the Engine shouldn't do it, since non-engine consumers of the InstallLogger may want it.


Thanks,

--Karen

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

Reply via email to