Introduce test_ust_python_agent_vs_tools.py
[deliverable/lttng-ivc.git] / lttng_ivc / apps / python / app.py
CommitLineData
2094d672
JR
1import lttngust
2import logging
3import time
4import argparse
5
6parser = argparse.ArgumentParser(description='Python tracing example.')
7parser.add_argument('-i', '--iterations', type=int, help='The number of loop iterations', required=True)
8
9args = parser.parse_args()
10args.iterations
11
12def example(iteration):
13 ch = logging.StreamHandler()
14 ch.setLevel(logging.DEBUG)
15
16 logger = logging.getLogger('pello')
17 logger.addHandler(ch)
18
19 for i in range(iteration):
20 logger.debug('debug message')
21 logger.info('info message')
22 logger.warn('warn message')
23 logger.error('error message')
24 logger.critical('critical message')
25
26
27if __name__ == '__main__':
28 example(args.iterations)
This page took 0.027095 seconds and 5 git commands to generate.