Ejemplo n.º 1
0
def init(game, options):
    game.seed = options.seed
    game.mapFilename = options.mapFilename
    game.shouldSaveImage = options.shouldSaveImage
    game.numMaps = options.numMaps
    game.shouldExitAfterMapgen = options.shouldExitAfterMapgen
    game.isRecording = options.isRecording
    if options.logLevel is not None:
        import logger
        logger.setLogLevel(options.logLevel)

    game.shouldDisplayFPS = 1
    pygame.display.set_caption('Jetblade')
Ejemplo n.º 2
0
def main():
    logger.setLogLevel(logger.DEBUG)

    l = Lock()
    cur_running = Value('d', 0)
    p_command_me = Process(target=command_me.func, args=(l,))
    p_rainbow = Process(target=rainbow.func, args=(l,cur_running, 1))

    p_bored = Process(target=bored.func, args=(l, cur_running, 2))

    p_command_me.start()
    p_rainbow.start()
    #p_bored.start()

    print 'All process start()\'s invoked'

    p_command_me.join()
    p_rainbow.join()
Ejemplo n.º 3
0
def main():
    logger.setLogLevel(logger.DEBUG)

    l = Lock()
    cur_running = Value('d', 0)
    p_command_me = Process(target=command_me.func, args=(l, ))
    p_ewust = Process(target=twitter.func, args=(l, ))
    p_rainbow = Process(target=rainbow.func, args=(l, cur_running, 1))

    p_bored = Process(target=bored.func, args=(l, cur_running, 2))

    p_command_me.start()
    p_ewust.start()
    p_rainbow.start()
    p_bored.start()

    print 'All process start()\'s invoked'

    p_command_me.join()
    p_ewust.join()
    p_rainbow.join()
    p_bored.join()
Ejemplo n.º 4
0
    log(FATAL, data)

def none(data):
    # Uh...what?
    pass 


if __name__ == "__main__":
    # Unit test/example usage:
    import logger

    # Set the logging type you want to use (stdout logging):
    logger.setLogger(FileLogger(sys.stdout))

    # Set the most verbose you want to log (TRACE, DEBUG, INFO, WARN, ERROR, FATAL, NONE)
    logger.setLogLevel(logger.TRACE)

    # Log a message:
    logger.log(logger.INFO, "logger!")

    time.sleep(0.01)

    # Alternatively, use 
    logger.error("errrrr")

    logger.trace("some trace data: %d - %f - %s" % (5, 8.3, 'cows'))




Ejemplo n.º 5
0
            else:
                log.debug("interrupted ... maybe a shutdown ??")
                time.sleep(1)

    # end of main loop
    log.info("app. is shutting down ... have a nice day!")
    _shutdownEvent.set()
    time.sleep(4)


# Execution or import
if __name__ == "__main__":

    #
    print("\n###\n[neOCampus] dataCOllector app.\n###")

    # defined debug mode ?
    if (os.getenv("DEBUG") == '1' or os.getenv("DEBUG") is True):
        log.info("DEBUG mode activation ...")
        setLogLevel(logging.DEBUG)
        # print all environment variables
        print(os.environ)

    #sys.exit(0)

    # Start main app.
    main()

# The END - Jim Morrison 1943 - 1971
#sys.exit(0)
Ejemplo n.º 6
0
def set_log_level(level):
    setLogLevel(level)
Ejemplo n.º 7
0
def none(data):
    # Uh...what?
    pass


# default
setLogger(FileLogger(sys.stdout))
setLogLevel(INFO)

if __name__ == "__main__":
    # Unit test/example usage:
    import logger

    # Set the most verbose you want to log (TRACE, DEBUG, INFO, WARN, ERROR, FATAL, NONE)
    logger.setLogLevel(logger.INFO)

    logger.info(
        "This is a long line, it's pretty long, butitalso hasbig wordsthat areprobably hardtobreak oninan easywayforthe ncurseslib, sowhatdoes itdo then?"
    )
    logger.info("aa " + "a" * 70 + "B")

    for i in range(20):
        logger.info("iteration #%d/20" % i)
        time.sleep(0.3)

    # Alternatively, use
    logger.error("errrrr")

    logger.trace("some trace data: %d - %f - %s" % (5, 8.3, 'cows'))
Ejemplo n.º 8
0
    log(FATAL, data)

def none(data):
    # Uh...what?
    pass 

# default
setLogger(FileLogger(sys.stdout))
setLogLevel(INFO)

if __name__ == "__main__":
    # Unit test/example usage:
    import logger

    # Set the most verbose you want to log (TRACE, DEBUG, INFO, WARN, ERROR, FATAL, NONE)
    logger.setLogLevel(logger.INFO)

    logger.info("This is a long line, it's pretty long, butitalso hasbig wordsthat areprobably hardtobreak oninan easywayforthe ncurseslib, sowhatdoes itdo then?")
    logger.info("aa " + "a"*70 + "B")

    for i in range(20):
        logger.info("iteration #%d/20" % i)
        time.sleep(0.3)


    # Alternatively, use 
    logger.error("errrrr")

    logger.trace("some trace data: %d - %f - %s" % (5, 8.3, 'cows'))

Ejemplo n.º 9
0

def fatal(data):
    log(FATAL, data)


def none(data):
    # Uh...what?
    pass


if __name__ == "__main__":
    # Unit test/example usage:
    import logger

    # Set the logging type you want to use (stdout logging):
    logger.setLogger(FileLogger(sys.stdout))

    # Set the most verbose you want to log (TRACE, DEBUG, INFO, WARN, ERROR, FATAL, NONE)
    logger.setLogLevel(logger.TRACE)

    # Log a message:
    logger.log(logger.INFO, "logger!")

    time.sleep(0.01)

    # Alternatively, use
    logger.error("errrrr")

    logger.trace("some trace data: %d - %f - %s" % (5, 8.3, 'cows'))