Factor debug-area-enabling into a function.

This will make it easier to change to Qt categorized logging.