]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1190] Init logging in msgq
authorMichal 'vorner' Vaner <michal.vaner@nic.cz>
Mon, 17 Dec 2012 19:10:13 +0000 (20:10 +0100)
committerMichal 'vorner' Vaner <michal.vaner@nic.cz>
Mon, 17 Dec 2012 19:10:13 +0000 (20:10 +0100)
Using some hardcoded values for file and severity. This is a temporary
solution, and we should improve on that, but currently it is not
possible to get the configuration in msgq (even though the msgq is used
to send it everywhere else).

src/bin/msgq/msgq.py.in

index bd13a1c188e219cf0185fa11413b819715b46af7..fda1b2371a01b7dcb5f4a9505263cb336764d615 100755 (executable)
@@ -31,6 +31,7 @@ import select
 import random
 from optparse import OptionParser, OptionValueError
 import isc.util.process
+import isc.log
 
 import isc.cc
 
@@ -563,6 +564,16 @@ if __name__ == "__main__":
                       help="UNIX domain socket file the msgq daemon will use")
     (options, args) = parser.parse_args()
 
+    # Init logging, according to the parameters.
+    # FIXME: Do proper logger configuration, this is just a hack
+    sev = 'INFO'
+    if options.verbose:
+        sev = 'DEBUG'
+    LOG_FILE = os.path.join("@localstatedir@", "@PACKAGE_NAME@",
+                            "msgq.log").replace("${prefix}", "@prefix@")
+    isc.log.init("b10-msgq", buffer=False, severity=sev, debuglevel=99,
+                 file=LOG_FILE)
+
     signal.signal(signal.SIGTERM, signal_handler)
 
     # Announce startup.