On this page
  1. logging.getLogger
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

logging.getLogger

Prev: logging.getLevelNamesMapping | Up: logging | Next: logging.getLoggerClass
Rel: logging.addLevelName, logging.basicConfig, logging.BufferingFormatter, logging.captureWarnings
Ref: docs.python.org — logging.getLogger
Tags: #public #python3 #stdlib #logging


Import

import logging
from logging import getLogger

Signature & Overview

logging.getLogger(name=None)

Return a logger with the specified name, creating it if necessary.

Usage

import logging

pkg = logging.getLogger("pkg")
a = logging.getLogger("pkg.mod")
b = logging.getLogger("pkg.mod")
assert a is b and a.parent is pkg

Gotchas

REPL Inspect

from logging import getLogger
help(getLogger)

Linked from

Related notes