parameters: (args)
docstring: Configure the logger according to the arguments
  
      Parameters
      ----------
      args: argparser.Arguments
         The arguments passed in by the user.
docstring_summary: Configure the logger according to the arguments
docstring_tokens: Configure the logger according to the arguments
function: def config_logger(args):
      """Configure the logger according to the arguments
  
      Parameters
      ----------
      args: argparser.Arguments
         The arguments passed in by the user.
      """
      fmt = '%(asctime)s %(levelname)s %(message)s'
      if args.log_level == 'INFO':
          level = logging.INFO
      elif args.log_level == 'DEBUG':
          level = logging.DEBUG
      else:
          raise RuntimeError("Unknown logging level %s" % args.log_level)
  
      if args.log_file is None:
          logging.basicConfig(format=fmt, level=level)
      else:
          logging.basicConfig(format=fmt, level=level, filename=args.log_file)
          console = logging.StreamHandler()
          console.setFormatter(logging.Formatter(fmt))
          console.setLevel(level)
          logging.getLogger('').addHandler(console)
function_tokens: def config_logger ( args ) : fmt = '%(asctime)s %(levelname)s %(message)s' if args . log_level == 'INFO' : level = logging . INFO elif args . log_level == 'DEBUG' : level = logging . DEBUG else : raise RuntimeError ( "Unknown logging level %s" % args . log_level ) if args . log_file is None : logging . basicConfig ( format = fmt , level = level ) else : logging . basicConfig ( format = fmt , level = level , filename = args . log_file ) console = logging . StreamHandler ( ) console . setFormatter ( logging . Formatter ( fmt ) ) console . setLevel ( level ) logging . getLogger ( '' ) . addHandler ( console )