Skip to content

Logging and Debugging

Walker Herring edited this page May 12, 2021 · 10 revisions

This project contains a small logging utility that is useful for debugging.
To use it, first import it into your file.
from logger import log, writelog
To make a log, do log('MY_TAG', 'my debugging statement or info log')
To print all logs with the tag 'MY_TAG', do writelog('MY_TAG')

Open logger_config.cfg to edit the following settings: -enabled enables or disables the logger across the entire project. This allows you to disable it in a production environment to ensure it isn't slowing things down. -log_timestamps if true, prints the time the log was created along with the log -output determines where writelog writes logs to. Can be set to "console" for console output or a file name for file output.

Clone this wiki locally