scripts/weatherpub.py
def init_log( quiet, debug ):
   '''
   setup system logging to desired verbosity.
   '''
   from logging.handlers import SysLogHandler
   fmt = logging.Formatter( os.path.basename(sys.argv[0]) +
         ".%(name)s %(levelname)s - %(message)s")
   facility = SysLogHandler.LOG_DAEMON
   syslog = SysLogHandler(address='/dev/log',facility=facility)
   syslog.setFormatter( fmt )
   log.addHandler(syslog)
   if not quiet:
      console = logging.StreamHandler()
      console.setFormatter( fmt )
      log.addHandler(console)
      log.setLevel(logging.INFO)
      if debug:
         log.setLevel(logging.DEBUG)
def init_log( quiet, debug ):
   '''
   setup system logging to desired verbosity.
   '''
   from logging.handlers import SysLogHandler
   fmt = logging.Formatter( os.path.basename(sys.argv[0]) +
         ".%(name)s %(levelname)s - %(message)s")
   facility = SysLogHandler.LOG_DAEMON
   syslog = SysLogHandler(address='/dev/log',facility=facility)
   syslog.setFormatter( fmt )
   log.addHandler(syslog)
   if not quiet:
      console = logging.StreamHandler()
      console.setFormatter( fmt )
      log.addHandler(console)
      log.setLevel(logging.INFO)
      if debug:
         log.setLevel(logging.DEBUG)
def init_log ( quiet , debug ) : from logging . handlers import SysLogHandler fmt = logging . Formatter ( os . path . basename ( sys . argv [ 0 ] ) + ".%(name)s %(levelname)s - %(message)s" ) facility = SysLogHandler . LOG_DAEMON syslog = SysLogHandler ( address = '/dev/log' , facility = facility ) syslog . setFormatter ( fmt ) log . addHandler ( syslog ) if not quiet : console = logging . StreamHandler ( ) console . setFormatter ( fmt ) log . addHandler ( console ) log . setLevel ( logging . INFO ) if debug : log . setLevel ( logging . DEBUG )
setup system logging to desired verbosity.
setup system logging to desired verbosity .