Introduce test_ust_python_agent_vs_tools.py
[deliverable/lttng-ivc.git] / lttng_ivc / apps / python / app.py
diff --git a/lttng_ivc/apps/python/app.py b/lttng_ivc/apps/python/app.py
new file mode 100644 (file)
index 0000000..f8b3081
--- /dev/null
@@ -0,0 +1,28 @@
+import lttngust
+import logging
+import time
+import argparse
+
+parser = argparse.ArgumentParser(description='Python tracing example.')
+parser.add_argument('-i', '--iterations', type=int, help='The number of loop iterations', required=True)
+
+args = parser.parse_args()
+args.iterations
+
+def example(iteration):
+    ch = logging.StreamHandler()
+    ch.setLevel(logging.DEBUG)
+
+    logger = logging.getLogger('pello')
+    logger.addHandler(ch)
+
+    for i in range(iteration):
+        logger.debug('debug message')
+        logger.info('info message')
+        logger.warn('warn message')
+        logger.error('error message')
+        logger.critical('critical message')
+
+
+if __name__ == '__main__':
+    example(args.iterations)
This page took 0.02337 seconds and 5 git commands to generate.