[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [PATCH 1/2 master] Improve logging of ifcfg stuff.

On 09/08/2010 01:34 PM, Ales Kozumplik wrote:
On 08/23/2010 01:05 PM, Radek Vykydal wrote:
Still logging into /tmp/ifcfg.log, but now
- standard format is used,
- values of IfcfgFile are removed (only what would be written-out,
   that is __str__() output is kept) - it was only confusing,
   should be part of unit tests if anything
- logging of some events is added (e.g. Network.write(),
  pyanaconda/gui.py     |    6 ++-
pyanaconda/network.py | 105 ++++++++++++++++++++++++-------------------------
  2 files changed, 56 insertions(+), 55 deletions(-)

Ack, with two comments:

diff --git a/pyanaconda/network.py b/pyanaconda/network.py
index 5dc81cb..8998759 100644
--- a/pyanaconda/network.py
+++ b/pyanaconda/network.py
@@ -49,6 +49,19 @@ networkConfFile = "%s/network" % (sysconfigDir)
  ifcfgLogFile = "/tmp/ifcfg.log"

+# Setup special logging for ifcfg NM interface
+from pyanaconda import anaconda_log
+logger = logging.getLogger("ifcfg")
+anaconda_log.logger.addFileHandler(ifcfgLogFile, logger, logging.DEBUG)
+anaconda_log.logger.addFileHandler("/dev/tty3", logger,
+                                   anaconda_log.DEFAULT_TTY_LEVEL,
+                                   anaconda_log.TTY_FORMAT,
+                                   autoLevel=True)
+ifcfglog = logging.getLogger("ifcfg")

1) for a lack of better places to put this.. One day I'd like to move storage log init and now this log init too into anaconda_log.py.

Yeah, I was imagining something like that so I followed storage logging here.

2) if you want ifcfg messages to be correctly filed during remote logging, you need to update scripts/analog too. You can inspire yourself with how we handle "storage" there. Please either do this (the recommended option) or remove the "forwardToSyslog" call.

I will send update of analog in another patch.

Thanks for the review.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]