07-18-2019 11:17 AM
I'm playing around with using Genie in a python script. Whenever I do anything with Genie, like device.connect(), it prints the output to the console. How do I suppress that? Thanks, Mike
Solved! Go to Solution.
10-15-2019 05:29 AM
10-11-2019 08:38 AM - edited 10-11-2019 08:38 AM
Given a device instance, you can change the log settings via the connectionmgr instance.
For example:
import logging
# dev is a Device instance from a testbed
dev.connectionmgr.log.setLevel(logging.ERROR)
# now execute a command and you will not see the output on the console
resp = dev.execute('show version')
# you can print the response
print(resp)
10-15-2019 05:29 AM
10-20-2019 06:14 PM
Thanks Jeremy! That did the trick. However when I use dev.connect(log_stdout=False) then the output is not logged to a file. A few follow up questions: