aboutsummaryrefslogtreecommitdiff
path: root/examples/example2
diff options
context:
space:
mode:
authorCody Hiar <cody@hiar.ca>2019-10-16 10:36:14 -0600
committerCody Hiar <cody@hiar.ca>2019-10-16 10:36:14 -0600
commit81f10379aa6de8da03ea9553d54252435a48dbea (patch)
treec023c7f11d846bd6ab87c5946764dcf13f135e6c /examples/example2
Initial commit
Diffstat (limited to 'examples/example2')
-rw-r--r--examples/example2/library1.py12
-rw-r--r--examples/example2/main.py13
2 files changed, 25 insertions, 0 deletions
diff --git a/examples/example2/library1.py b/examples/example2/library1.py
new file mode 100644
index 0000000..a47a6da
--- /dev/null
+++ b/examples/example2/library1.py
@@ -0,0 +1,12 @@
+import logging
+import sys
+
+logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
+logger = logging.getLogger(__name__)
+
+
+def foo():
+ logger.debug("Library1")
+
+if __name__ == "__main__":
+ foo()
diff --git a/examples/example2/main.py b/examples/example2/main.py
new file mode 100644
index 0000000..12b8343
--- /dev/null
+++ b/examples/example2/main.py
@@ -0,0 +1,13 @@
+import logging
+import sys
+
+import library1
+
+logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
+logger = logging.getLogger(__name__)
+
+# Uncomment below to mute Library1's debug
+# logging.getLogger("library1").setLevel(logging.INFO)
+library1.foo()
+
+logger.debug("Main File")