@@ -46,7 +46,7 @@ def on_ready(self, agent):
4646 last_lines = self .get_last_lines ('journalctl' , ['-n10' , '-k' ], 10 )
4747 try :
4848 cmd_output = subprocess .check_output ("ip link show wlan0mon" , shell = True )
49- logging .info ("[Fix_Services ip link show wlan0mon]: %s" % repr (cmd_output ))
49+ logging .debug ("[Fix_Services ip link show wlan0mon]: %s" % repr (cmd_output ))
5050 if ",UP," in str (cmd_output ):
5151 logging .info ("wlan0mon is up." )
5252
@@ -122,7 +122,7 @@ def on_epoch(self, agent, epoch, epoch_data):
122122
123123 # Look for pattern 1
124124 if len (self .pattern .findall (last_lines )) >= 3 :
125- logging .info ("[Fix_Services]**** Should trigger a reload of the wlan0mon device:\n %s" % last_lines )
125+ logging .debug ("[Fix_Services]**** Should trigger a reload of the wlan0mon device:\n %s" % last_lines )
126126 if hasattr (agent , 'view' ):
127127 display = agent .view ()
128128 display .set ('status' , 'Blind-Bug detected. Restarting.' )
@@ -135,7 +135,7 @@ def on_epoch(self, agent, epoch, epoch_data):
135135
136136 # Look for pattern 2
137137 elif len (self .pattern2 .findall (other_last_lines )) >= 5 :
138- logging .info ("[Fix_Services]**** Should trigger a reload of the wlan0mon device:\n %s" % last_lines )
138+ logging .debug ("[Fix_Services]**** Should trigger a reload of the wlan0mon device:\n %s" % last_lines )
139139 if hasattr (agent , 'view' ):
140140 display = agent .view ()
141141 display .set ('status' , 'Wifi channel stuck. Restarting recon.' )
@@ -167,7 +167,7 @@ def on_epoch(self, agent, epoch, epoch_data):
167167 try :
168168 # Run the monstart command to restart wlan0mon
169169 cmd_output = subprocess .check_output ("monstart" , shell = True )
170- logging .info ("[Fix_Services monstart]: %s" % repr (cmd_output ))
170+ logging .debug ("[Fix_Services monstart]: %s" % repr (cmd_output ))
171171 except Exception as err :
172172 logging .error ("[Fix_Services monstart]: %s" % repr (err ))
173173
@@ -181,7 +181,7 @@ def on_epoch(self, agent, epoch, epoch_data):
181181 try :
182182 # Run the monstart command to restart wlan0mon
183183 cmd_output = subprocess .check_output ("monstart" , shell = True )
184- logging .info ("[Fix_Services monstart]: %s" % repr (cmd_output ))
184+ logging .debug ("[Fix_Services monstart]: %s" % repr (cmd_output ))
185185 except Exception as err :
186186 logging .error ("[Fix_Services monstart]: %s" % repr (err ))
187187
@@ -237,7 +237,7 @@ def _tryTurningItOffAndOnAgain(self, connection):
237237 # is it up?
238238 try :
239239 cmd_output = subprocess .check_output ("ip link show wlan0mon" , shell = True )
240- logging .info ("[Fix_Services ip link show wlan0mon]: %s" % repr (cmd_output ))
240+ logging .debug ("[Fix_Services ip link show wlan0mon]: %s" % repr (cmd_output ))
241241 if ",UP," in str (cmd_output ):
242242 logging .info ("wlan0mon is up. Skip reset?" )
243243 # not reliable, so don't skip just yet
@@ -309,11 +309,9 @@ def _tryTurningItOffAndOnAgain(self, connection):
309309 # stop looping and get back to recon
310310 break
311311 else :
312- logging .info (
313- "[Fix_Services set wifi.interfaceface wlan0mon] failed? %s" % repr (result ))
312+ logging .debug ("[Fix_Services set wifi.interfaceface wlan0mon] failed? %s" % repr (result ))
314313 except Exception as err :
315- logging .info (
316- "[Fix_Services set wifi.interface wlan0mon] except: %s" % repr (err ))
314+ logging .debug ("[Fix_Services set wifi.interface wlan0mon] except: %s" % repr (err ))
317315 except Exception as cerr : #
318316 if not display :
319317 print ("failed loading wlan0mon attempt #%s: %s" % (tries , repr (cerr )))
@@ -362,7 +360,7 @@ def _tryTurningItOffAndOnAgain(self, connection):
362360 "face" : faces .HAPPY })
363361 else :
364362 print ("I can see again" )
365- logging .info ("[Fix_Services] wifi.recon on" )
363+ logging .debug ("[Fix_Services] wifi.recon on" )
366364 self .LASTTRY = time .time () + 120 # 2-minute pause until next time.
367365 else :
368366 logging .error ("[Fix_Services] wifi.recon did not start up" )
@@ -378,7 +376,7 @@ def on_unload(self, ui):
378376 try :
379377 logging .info ("[Fix_Services] unloaded" )
380378 except Exception as err :
381- logging .info ("[Fix_Services] unload err %s " % repr (err ))
379+ logging .error ("[Fix_Services] unload err %s " % repr (err ))
382380 pass
383381
384382
0 commit comments