Skip to content

Instantly share code, notes, and snippets.

@bellerbrock
Last active March 19, 2020 16:20
Show Gist options
  • Save bellerbrock/68c3e5bd2ddd13324780b12ff8882f11 to your computer and use it in GitHub Desktop.
Save bellerbrock/68c3e5bd2ddd13324780b12ff8882f11 to your computer and use it in GitHub Desktop.
Enable logging in RTT
# Add to beginning of cgi:
import logging
import pprint
import config
pp = pprint.PrettyPrinter(indent=4)
logging.basicConfig(filename=config.ROOT_PATH+"/rtt.log", level=logging.DEBUG)
# Add debugging print statements like this
logging.debug("reordering following sequence at depth " + str(depth))
logging.debug(pp.pformat(sequence))
# Run these commands to initialize logfile:
touch rtt.log
chmod 777 rtt.log
# Then to see and follow the log while you test:
tail -f -n 100 rtt.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment