File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -59,20 +59,28 @@ logging handler privided by plugin like bellow:
5959
6060.. code-block :: python
6161
62- # Import Report Portal handler in the test module.
62+ import logging
63+ # Import Report Portal handler to the test module.
6364 from pytest_reportportal import RPlogHandler
64- # Get logger.
65- logger = logging.getLogger()
66- # Create hanler, set log level add it to the logger.
65+ # Setting up a logging.
66+ logger = logging.getLogger(__name__ )
67+ logger.setLevel(logging.DEBUG )
68+ # Create handler for Report Portal.
6769 rp_handler = RPlogHandler()
70+ # Set INFO level for Report Portal handler.
6871 rp_handler.setLevel(logging.INFO )
72+ # Add handler to the logger.
6973 logger.addHandler(rp_handler)
74+
75+
7076 # In this case only INFO messages will be sent to the Report Portal.
71- def test_one (self ):
77+ def test_one ():
7278 logger.info(" Case1. Step1" )
7379 x = " this"
74- logger.info(" Case1. Step2 " )
80+ logger.info(" x is: %s " , x )
7581 assert ' h' in x
82+ # This debug message will not be sent to the Report Portal.
83+ logger.debug(" Case1. Debug message" )
7684
7785
7886 Launching
You can’t perform that action at this time.
0 commit comments