logging.getLogger()
logging.getLogger() is a Python function in the Logging Module category. Returns a logger with the specified name or the root logger if name is None. The syntax is logging.getLogger(name=None). Parameters: name — logger name (usually __name__). Returns: Logger object. A typical example: logger = logging.getLogger(__name__)
logger.info("This is a log message"). A close sibling is logging.basicConfig(), which configures the root logger with a basic configuration. A close sibling is logger.debug(), which logs a message with severity DEBUG (detailed diagnostic info). A close sibling is logger.info(), which logs a message with severity INFO (general operational messages). A close sibling is logger.warning(), which logs a message with severity WARNING (potential issue). More about this category: Logging facility — basicConfig, getLogger, FileHandler, Formatter. For a broader walkthrough, read the Logging Module guide. Related Logging Module entries: logging.basicConfig(), logger.debug(), logger.info(), logger.warning(), logger.error(), logger.critical().