Beispiel #1
0
def log_each(logger: Logger):
    logger.log_error('error msg')
    logger.log_warn('warn msg')
    logger.log_info('info blue msg')
    logger.log_success('success msg')
    logger.log_debug('debug msg')
    logger.log_trace('trace msg')
Beispiel #2
0
        except PicklingError as error:
            logger.log_error(f'Unable to pickle tasks\n{error}')
            return False
        except CompressionException as error:
            logger.log_error(f'Unable to compress pickled tasks\n{error}')
            return False
        except FileNotFoundError as error:
            logger.log_error(f'Send_tasks file not found\n{error}')
            return False
        except Exception as error:
            logger.log_error(f'Send_tasks broad exception\n{error}')
            return False


if __name__ == "__main__":
    MASTER_PORT = 5678

    client: HyperSlave = HyperSlave(MASTER_PORT)
    client.start()
    while True:
        try:
            if not client.running and not client.job_done:
                del client
                client: HyperSlave = HyperSlave(MASTER_PORT)
                client.start()
            if client.job_done:
                break
        except KeyboardInterrupt:
            logger.log_debug('Graceful shutdown...')
            break