]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS NFC: Logging level configuration to wps-nfc.py and wps-ap-nfc.py
authorJouni Malinen <jouni@qca.qualcomm.com>
Sat, 30 Nov 2013 14:49:04 +0000 (16:49 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 27 Jan 2014 20:08:13 +0000 (22:08 +0200)
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

hostapd/wps-ap-nfc.py
wpa_supplicant/examples/wps-nfc.py

index 8fe7b9e17409e01c5b51c9b4f9cc1a01cca25cb8..b9e233eb1234456c2611f755092fc11cd8d1b5a0 100755 (executable)
@@ -17,7 +17,6 @@ import nfc.llcp
 import nfc.handover
 
 import logging
-logging.basicConfig()
 
 import wpaspy
 
@@ -214,6 +213,11 @@ def main():
     clf = nfc.ContactlessFrontend()
 
     parser = argparse.ArgumentParser(description='nfcpy to hostapd integration for WPS NFC operations')
+    parser.add_argument('-d', const=logging.DEBUG, default=logging.INFO,
+                        action='store_const', dest='loglevel',
+                        help='verbose debug output')
+    parser.add_argument('-q', const=logging.WARNING, action='store_const',
+                        dest='loglevel', help='be quiet')
     parser.add_argument('--only-one', '-1', action='store_true',
                         help='run only one operation and exit')
     parser.add_argument('--no-wait', action='store_true',
@@ -229,6 +233,8 @@ def main():
     global no_wait
     no_wait = args.no_wait
 
+    logging.basicConfig(level=args.loglevel)
+
     try:
         if not clf.open("usb"):
             print "Could not open connection with an NFC device"
index 0680be609b0dd2b7ad73d8b013e4d141ac8d15a4..c349b4698d8d7d8e58679066d6424f81c36aca8d 100755 (executable)
@@ -20,7 +20,6 @@ import nfc.llcp
 import nfc.handover
 
 import logging
-logging.basicConfig()
 
 import wpaspy
 
@@ -374,6 +373,11 @@ def main():
     clf = nfc.ContactlessFrontend()
 
     parser = argparse.ArgumentParser(description='nfcpy to wpa_supplicant integration for WPS NFC operations')
+    parser.add_argument('-d', const=logging.DEBUG, default=logging.INFO,
+                        action='store_const', dest='loglevel',
+                        help='verbose debug output')
+    parser.add_argument('-q', const=logging.WARNING, action='store_const',
+                        dest='loglevel', help='be quiet')
     parser.add_argument('--only-one', '-1', action='store_true',
                         help='run only one operation and exit')
     parser.add_argument('--no-wait', action='store_true',
@@ -397,6 +401,8 @@ def main():
     global no_wait
     no_wait = args.no_wait
 
+    logging.basicConfig(level=args.loglevel)
+
     try:
         if not clf.open("usb"):
             print "Could not open connection with an NFC device"