@@ -37,11 +37,11 @@ def check_and_import_zones(api):
3737
3838 # if we have a 'no' inside local monitor section, don't import
3939 if mid in g .monitor_config and g .monitor_config [mid ].get ('import_zm_zones' ) == 'no' :
40- g .logger .Debug (4 ,'Not importing zones for monitor:{} as the monitor specific section says no' .format (mid ))
40+ g .logger .Debug (1 ,'Not importing zones for monitor:{} as the monitor specific section says no' .format (mid ))
4141 continue
4242 # else if global is no, and there is no local, don't import
4343 elif g .config ['import_zm_zones' ] == 'no' and (mid not in g .monitor_config or not g .monitor_config [mid ].get ('import_zm_zones' )):
44- g .logger .Debug (4 ,'Not importing zone:{} for monitor:{} as the global setting says no and there is no local override' .format (item ['Zone' ]['Name' ], mid ))
44+ g .logger .Debug (1 ,'Not importing zone:{} for monitor:{} as the global setting says no and there is no local override' .format (item ['Zone' ]['Name' ], mid ))
4545 continue
4646
4747 # At this stage, global is 'yes' and local is either unspecified or has 'yes'
@@ -51,7 +51,7 @@ def check_and_import_zones(api):
5151 g .monitor_polygons [mid ] = []
5252
5353 if item ['Zone' ]['Type' ] == 'Inactive' :
54- g .logger .Debug (2 , 'Skipping {} as it is inactive' .format (item ['Zone' ]['Name' ]))
54+ g .logger .Debug (1 , 'Skipping {} as it is inactive' .format (item ['Zone' ]['Name' ]))
5555 continue
5656
5757 item ['Zone' ]['Name' ] = item ['Zone' ]['Name' ].replace (' ' ,'_' ).lower ()
@@ -299,13 +299,13 @@ def _set_config_val(k,v):
299299 ml = config_file .get ('ml' , 'ml_sequence' )
300300 g .monitor_config [mid ]['ml_sequence' ]= ml
301301 except :
302- g .logger .Debug (4 , 'ml sequence not found in globals' )
302+ g .logger .Debug (2 , 'ml sequence not found in globals' )
303303
304304 try :
305305 ss = config_file .get ('ml' , 'stream_sequence' )
306306 g .monitor_config [mid ]['stream_sequence' ]= ss
307307 except :
308- g .logger .Debug (4 , 'stream sequence not found in globals' )
308+ g .logger .Debug (2 , 'stream sequence not found in globals' )
309309
310310 for item in config_file [sec ].items ():
311311 k = item [0 ]
@@ -318,7 +318,7 @@ def _set_config_val(k,v):
318318 else :
319319 if k in g .config_vals :
320320 # This means its a legit config key that needs to be overriden
321- g .logger .Debug (4 ,'[{}] overrides key:{} with value:{}' .format (sec , k , v ))
321+ g .logger .Debug (2 ,'[{}] overrides key:{} with value:{}' .format (sec , k , v ))
322322 g .monitor_config [mid ][k ]= _correct_type (v ,g .config_vals [k ]['type' ])
323323 # g.monitor_config[mid].append({ 'key':k, 'value':_correct_type(v,g.config_vals[k]['type'])})
324324 else :
@@ -343,16 +343,14 @@ def _set_config_val(k,v):
343343 if k in g .config_vals :
344344 _set_config_val (k ,g .config_vals [k ] )
345345 else :
346- #g.logger.Debug(4, 'storing unknown attribute {}={}'.format(k,v))
347346 g .config [k ] = v
348- #_set_config_val(k,{'section': sec, 'default': None, 'type': 'string'} )
349347
350348
351349
352350
353351 # Parameter substitution
354352
355- g .logger .Debug (4 ,'Doing parameter substitution for globals' )
353+ g .logger .Debug (2 ,'Doing parameter substitution for globals' )
356354 p = r'{{(\w+?)}}'
357355 for gk , gv in g .config .items ():
358356 #input ('Continue')
@@ -369,11 +367,11 @@ def _set_config_val(k,v):
369367 g .config [gk ] = new_val
370368 gv = new_val
371369 else :
372- g .logger .Debug (4 , 'substitution key: {} not found' .format (match_key ))
370+ g .logger .Debug (2 , 'substitution key: {} not found' .format (match_key ))
373371 if not replaced :
374372 break
375373
376- g .logger .Debug (4 ,'Doing parameter substitution for monitor specific entities' )
374+ g .logger .Debug (2 ,'Doing parameter substitution for monitor specific entities' )
377375 p = r'{{(\w+?)}}'
378376 for mid in g .monitor_config :
379377 for key in g .monitor_config [mid ]:
@@ -398,7 +396,7 @@ def _set_config_val(k,v):
398396 gv = new_val
399397 g .monitor_config [mid ][key ] = gv
400398 else :
401- g .logger .Debug (4 , 'substitution key: {} not found' .format (match_key ))
399+ g .logger .Debug (2 , 'substitution key: {} not found' .format (match_key ))
402400 if not replaced :
403401 break
404402
0 commit comments