I will first assume that you are using APScheduler for cron-like behavior because if you were really running via cron(8)
every second, it would
- Be self-defeating because APScheduler claims it's a "far better alternative to externally run cron scripts…"
- Probably thrash the system something awful
That stipulated, the beauty of the logging module is that it allows your application to have broad control over a library's logging behavior without touching its code. Unfortunately, it makes logging
a little hard to understand at first.
Since the INFO
level reports stuff that you aren't interested in you can:
class NoRunningFilter(logging.Filter):
def filter(self, record):
return not record.msg.startswith('Running job')
my_filter = NoRunningFilter()
logging.getLogger("apscheduler.scheduler").addFilter(my_filter)
These can all be specified dynamically with a logging configuration file but that's a little more magic than I've ever gotten into.