def _verify_options(options):
 bitwise_args = [('level', options['level']), ('facility', options['facility'])]
 bitwise_args.extend([('option', x) for x in options['options']])
 for (opt_name, opt) in bitwise_args:
  if (not hasattr(syslog, opt)):
   log.error('syslog has no attribute {0}'.format(opt))
   return False
  if (not isinstance(getattr(syslog, opt), int)):
   log.error('{0} is not a valid syslog {1}'.format(opt, opt_name))
   return False
 if ('tag' in options):
  if (not isinstance(options['tag'], six.string_types)):
   log.error('tag must be a string')
   return False
  if (len(options['tag']) > 32):
   log.error('tag size is limited to 32 characters')
   return False
 return True

def _verify_options ( options ) : bitwise_args = [ ( 'level' , options [ 'level' ] ) , ( 'facility' , options [ 'facility' ] ) ] bitwise_args . extend ( [ ( 'option' , x ) for x in options [ 'options' ] ] ) for ( opt_name , opt ) in bitwise_args : if ( not hasattr ( syslog , opt ) ) : log . error ( 'syslog has no attribute {0}' . format ( opt ) ) return False if ( not isinstance ( getattr ( syslog , opt ) , int ) ) : log . error ( '{0} is not a valid syslog {1}' . format ( opt , opt_name ) ) return False if ( 'tag' in options ) : if ( not isinstance ( options [ 'tag' ] , six . string_types ) ) : log . error ( 'tag must be a string' ) return False if ( len ( options [ 'tag' ] ) > 32 ) : log . error ( 'tag size is limited to 32 characters' ) return False return True
verify options and log warnings returns true if all options can be verified .