Skip to content

Commit 15fc22f

Browse files
committed
Fix simple test example
1 parent 969f3b0 commit 15fc22f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

examples/logging_simpletest.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
# This should produce an error output
1212

1313
logger = logging.getLogger("test")
14+
print_logger = logging.StreamHandler()
15+
logger.addHandler(print_logger)
1416

1517
logger.setLevel(logging.ERROR)
1618
logger.info("Info message")
@@ -19,7 +21,8 @@
1921
# This should produce no output
2022

2123
null_logger = logging.getLogger(None)
22-
null_logger.addHandler(logging.NullHandler)
24+
null_handler = logging.NullHandler()
25+
null_logger.addHandler(null_handler)
2326

2427
null_logger.setLevel(logging.ERROR)
2528
null_logger.info("Info message")

0 commit comments

Comments
 (0)