On this page
  1. logging.Logger
  2. Import
  3. Signature & Overview
  4. Methods & Attributes
  5. Usage
  6. Gotchas
  7. REPL Inspect

logging.Logger

Prev: logging.log | Up: logging | Next: logging.LoggerAdapter
Rel: logging.addLevelName, logging.basicConfig, logging.BufferingFormatter, logging.captureWarnings
Ref: docs.python.org — logging.Logger
Tags: #public #python3 #stdlib #logging


Import

import logging
from logging import Logger

Signature & Overview

logging.Logger(name, level=0)

Instances of the Logger class represent a single logging channel. A "logging channel" indicates an area of an application. Exactly how an "area" is defined is up to the application developer. Since an

Methods & Attributes

Usage

import logging

logger = logging.getLogger("myapp.worker")
logger.setLevel(logging.DEBUG)
assert isinstance(logger, logging.Logger)
assert logger.isEnabledFor(logging.DEBUG)

Gotchas

REPL Inspect

from logging import Logger
help(Logger)

Linked from

Related notes