[Solved] What is the simplest way to setup a basic logger in python?


Ok, I just made a basic logging configuration module:

import logging
from logging import info, warning, debug, error

logging.basicConfig(format="%(asctime)s [%(levelname)s] %(message)s", level=logging.INFO)

That’s not much, but now you can just:

import basic_logging as log
log.info("hello")

Which outputs useful information by default. This is as simple as it gets, but it uses a real logger, which means you can very simply switch to more complex logging in the future. I might even publish it to Pypi.

solved What is the simplest way to setup a basic logger in python?