[node-patches] Change in ovirt-node[master]: app: Set default logger

fabiand at fedoraproject.org fabiand at fedoraproject.org
Fri Feb 8 15:45:20 UTC 2013


Fabian Deutsch has uploaded a new change for review.

Change subject: app: Set default logger
......................................................................

app: Set default logger

Previously only the logger for the ovirt.* namespace was configured,
this lead to problems with plugins that reconfigured logging.
Now the logger is also configured for the root namespace.
An additional function was added to reconfigure the logging with sane
defaults.

Change-Id: I7ef89a839c9d0fc1593ff634c5f9730e68f71555
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M scripts/tui/src/ovirt/node/app.py
1 file changed, 8 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/61/11861/1

diff --git a/scripts/tui/src/ovirt/node/app.py b/scripts/tui/src/ovirt/node/app.py
index f690142..feefea2 100644
--- a/scripts/tui/src/ovirt/node/app.py
+++ b/scripts/tui/src/ovirt/node/app.py
@@ -68,7 +68,7 @@
         }
     },
     'loggers': {
-        'ovirt': {
+        '': {
             'handlers': ['debug', 'stderr'],
             'level': 'DEBUG',
         },
@@ -79,11 +79,13 @@
     }
 }
 
-logging.config.dictConfig(LOGGING)
-#logging.basicConfig(level=logging.DEBUG,
-#                    filename="/tmp/app.log", filemode="w",
-#                    format="%(asctime)s %(levelname)s %(name)s %(message)s")
+def configure_logging():
+    logging.config.dictConfig(LOGGING)
+    #logging.basicConfig(level=logging.DEBUG,
+    #                    filename="/tmp/app.log", filemode="w",
+    #                    format="%(asctime)s %(levelname)s %(name)s %(message)s")
 
+configure_logging()
 
 class Application(base.Base):
     """The controller part when seeing as an MVC pattern
@@ -290,6 +292,7 @@
         try:
             self.ui.run()
         except Exception as e:
+            utils.process.call("reset")
             self.logger.error("An error appeared in the UI: %s" % repr(e))
             utils.console.writeln("Press ENTER to logout ...")
             utils.console.writeln("or enter 's' to drop to shell")


--
To view, visit http://gerrit.ovirt.org/11861
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7ef89a839c9d0fc1593ff634c5f9730e68f71555
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>



More information about the node-patches mailing list