The hslogger module provides a similar API to Python's logging framework, and supports hierarchically named loggers, levels and redirection to handles outside of stdout and stderr.
By default, all messages of level WARNING and above are sent to stderr and all other log levels are ignored.
import ...