Пример #1
0
def testLogger():
    logger = Logger("test logger",  level = logging.DEBUG)
    logger.info("info message")
    logger.warn("warn message")
    logger.error("error message")
    logger.fatal("fatal message")
    logger.close()
Пример #2
0
def testTracebackSimple():
    logger = Logger("test logger", level=logging.DEBUG)
    try:
        old_div(1, 0)
    except Exception:
        logger.getTracebackSimple()
        logger.error("exception", traceBack=True)
        logger.fatal("exception", traceBack=True)
    logger.close()
Пример #3
0
        apMonDestinations = tuple(apMonDestConf.split(','))
        logger.info("Initializing MonALISA ApMon, destinations: %s ..." %
                    (apMonDestinations, ))
        apMon = apmon.ApMon(apMonDestinations)
        apMon.enableBgMonitoring(True)
    else:
        logger.info("MonALISA ApMon is not enabled, no destinations "
                    "provided.")

    # use DNS names rather than IP address
    Pyro.config.PYRO_DNS_URI = True

    try:
        transfers = Transfers(conf, apMon, logger)
    except FDTCopyException, ex:
        logger.fatal(ex)
        # everything failed - all transfers
        if conf.get("report"):
            # TODO
            # if necessary - may take just the input or the copyjobfile
            # and generate something with everything assigned 1
            logger.error("Report file was required, can't generate it with "
                         "failure on this stage ...")
        if apMon:
            apMon.free()
        logger.warn("fdtcp finished.")
        logger.close()
        sys.exit(1)

    # main result status of the fdtcp app run, any failed transfer
    # from transfers.transfers causes whole app status set to 1
Пример #4
0
    logger.debug("Configuration values (processed): '%s'" % conf._options)
    
    apMonDestConf = conf.get("apMonDestinations")
    apMonDestinations = tuple(apMonDestConf.split(','))
    logger.info("Initializing MonALISA ApMon, destinations: %s ..." % (apMonDestinations,))
    apMon = apmon.ApMon(apMonDestinations)
    apMon.enableBgMonitoring(True)
    
    # use DNS names rather than IP address
    Pyro.config.PYRO_DNS_URI = True
    

    try:
        transfers = Transfers(conf, apMon, logger)
    except FDTCopyException, ex:
        logger.fatal(ex)
        # everything failed - all transfers
        if conf.get("report"):
            # TODO
            # if necessary - may take just the input or the copyjobfile
            # and generate something with everything assigned 1
            logger.error("Report file was required, can't generate it with "
                         "failure on this stage ...")
        apMon.free()
        logger.warn("fdtcp finished.")
        logger.close()
        sys.exit(1)
    
    
    try:
        for transfer in transfers.transfers.values():