On Tue, Feb 26, 2013 at 02:00:07AM -0300, Lucas Meneghel Rodrigues wrote:
[...]
> >diff --git a/qemu/tests/numa_opts.py b/qemu/tests/numa_opts.py
> >new file mode 100644
> >index 0000000..f8519e1
> >--- /dev/null
> >+++ b/qemu/tests/numa_opts.py
> >@@ -0,0 +1,56 @@
> >+from autotest.client.shared import error
> >+from virttest import qemu_vm
> >+
> >+import logging
> >+logger = logging.getLogger(__name__)
> >+dbg = logger.debug
> 
> I must say I spent some time trying to understand why you created a
> separate logger here, without any further setup. Care to explain?

Oops, I'm so used to write this on all code I write, that I didn't even
notice I had done it here without an explanation.  :-)

This just makes logging messages from this module appear under a
specific logger name instead of the root logger. There's no further
setup because no further setup is needed. Logging configuration is done
by the test runner, and if no logger-specific configuration is made, the
messages are propagated to the root logger. See:
http://docs.python.org/2/howto/logging.html#advanced-logging-tutorial

This is not very useful if only this module does that. But if every
module did that, it would be very easy to enable/disable/redirect/reconfigure
logging of specific modules without editing the modules themselves.
Also, even if no module-specific logging configuration is used, using
different loggers allow us to easily identify which module is generating
a log message (if we include the logger name in the log output).

> 
> Other than that, the test looks good and it's ready to be pushed,
> except for the need to quench my curiosity :)
> 
-- 
Eduardo

_______________________________________________
Virt-test-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/virt-test-devel

Reply via email to