def set_logging(log_level, myfilename=None):
 if (myfilename and ipython_version):
  try:
   if ipython_version.startswith('0.10'):
    __IPYTHON__.set_custom_exc((Exception,), ipython_exception_handler)
   else:
    ip = get_ipython()
    ip.set_custom_exc((Exception,), ipython_exception_handler)
  except NameError:
   sys.exc_clear()
 level = read_logging_level(log_level)
 if (level and myfilename):
  fileHandler = logging.FileHandler(filename=myfilename)
  fileHandler.setLevel(level)
  fileHandler.setFormatter(formatter)
  logger.addHandler(fileHandler)
  logger.removeHandler(consoleHandler)
  print 'Now logging to', myfilename, 'with level', log_level
 elif level:
  print 'Now logging with level', log_level
 logger.setLevel(level)

def set_logging ( log_level , myfilename = None ) : if ( myfilename and ipython_version ) : try : if ipython_version . startswith ( '0.10' ) : __IPYTHON__ . set_custom_exc ( ( Exception , ) , ipython_exception_handler ) else : ip = get_ipython ( ) ip . set_custom_exc ( ( Exception , ) , ipython_exception_handler ) except NameError : sys . exc_clear ( ) level = read_logging_level ( log_level ) if ( level and myfilename ) : fileHandler = logging . FileHandler ( filename = myfilename ) fileHandler . setLevel ( level ) fileHandler . setFormatter ( formatter ) logger . addHandler ( fileHandler ) logger . removeHandler ( consoleHandler ) print 'Now logging to' , myfilename , 'with level' , log_level elif level : print 'Now logging with level' , log_level logger . setLevel ( level )
this function sets the threshold for the logging system and .