From: Tobias Mueller Date: Thu, 13 Jan 2011 16:44:48 +0000 (+0100) Subject: Prepare file configured logging X-Git-Url: http://git.maemo.org/git/?p=pwnitter;a=commitdiff_plain;h=591c6f9fb5304b82a46b99713f72e9df484b6ece Prepare file configured logging It seems like it's a bit complicated to set up, hence it's just a FIXME right now. But the general idea is to have a configurable logging mechanism. --- diff --git a/pwnitter.py b/pwnitter.py index 67d3f75..4ef93eb 100755 --- a/pwnitter.py +++ b/pwnitter.py @@ -8,6 +8,7 @@ import dbus.service import dbus.mainloop.glib import getopt, sys, pcap, dpkt, re, httplib, urllib import logging +import logging.config import socket import time import gobject @@ -239,6 +240,7 @@ if __name__ == '__main__': 'warn': logging.WARN, 'error': logging.ERROR, 'critical': logging.CRITICAL}.get(options.loglevel, "warn") logging.basicConfig(level=loglevel) + #logging.config.fileConfig('logging.conf') #FIXME: Have file configured logging log = logging.getLogger("Main") dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) @@ -252,7 +254,7 @@ if __name__ == '__main__': #object.Start() loop = gobject.MainLoop() - print "Running example signal emitter service." + log.info("Running example signal emitter service.") # FIXME: This is debug code #gobject.idle_add(pwnitter.MessageSent)