Skip to content

Instantly share code, notes, and snippets.

@h4ndzdatm0ld
Created May 21, 2020 05:05
Show Gist options
  • Save h4ndzdatm0ld/7e98569ee524f91161119b2522890f06 to your computer and use it in GitHub Desktop.
Save h4ndzdatm0ld/7e98569ee524f91161119b2522890f06 to your computer and use it in GitHub Desktop.
Logging netmiko
def netmiko_logging():
''' Netmiko Logging - This creates a Log file (NetmikoLog.txt) under a new 'Logging' folder.. Does not overwrite (a+).
Log must end in .txt file as the program won't allow two .log files in the CWD.
'''
create_folder('Logging')
open('Logging/NetmikoLog.txt', 'a+')
logging.basicConfig(filename='Logging/NetmikoLog.txt', level=logging.DEBUG)
logger = logging.getLogger("netmiko")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment