GEMINI/Tutorial/GEC17/GENI_Desktop_and_GEMINI_blipp/ExecuteExperiment: netlogger_test.py

File netlogger_test.py, 398 bytes (added by kissel@cis.udel.edu, 6 years ago)
Line 
1#!/usr/bin/python
2
3import sys
4import logging
5import time
6import random
7from netlogger.nllog import get_logger
8from netlogger import nlapi, nllog
9
10log = nllog.get_logger(".mynamespace")
11handler = logging.StreamHandler(sys.stdout)
12log.addHandler(handler)
13log.set_meta(host=nlapi.get_host())
14log.setLevel(logging.INFO)
15
16while True:
17    log.info("random.number", VAL=random.random())
18    time.sleep(1)