Add logging/profiling support to Djblets
Review Request #483 — Created Aug. 2, 2008 and submitted
This adds a new piece of Middleware to Djblets that provides logging and profiling functionality. Or to be more specific, this defines loggers for use in Python's native logging module. On the first request, we create a logger for writing to a file, as defined by the settings of the project. If in DEBUG mode, we also define a logger to show all output on the console. A third logger is used for writing profile information, if the LOGGING_ALLOW_PROFILING option is set to True and a ?profiling=1 parameter is passed to the URL. This can be useful during development to help optimize applications. This also introduces a useful log_timed function that displays log messages for the beginning and end of an operation, shows the start and end times (using the native logging functionality), and then shows a warning or a critical log message depending on how long the operation takes.
Tested all features with my upcoming corresponding change in Review Board.