GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Python3.13 logging level not working · Issue #131789 · python/cpython

Python3.13 logging level not working #131789

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
Python3.13 logging level not working#131789
Copy link
Labels
invalid

Description

@trivialkettle
trivialkettle
opened on Mar 27, 2025
Issue body actions

Bug description:

Hi,
i noticed a regression in python 3.13.2 that the log level has no effect.
I tested the example from https://docs.python.org/3.13/library/logging.html

import logging
logger = logging.getLogger(__name__)

def main():
    logging.basicConfig(filename='myapp.log', level=logging.INFO)
    logger.info('Started')
    logger.info('Finished')

if __name__ == '__main__':
    main()
python3.13 example.py 

but nothing is printed.

CPython versions tested on:

3.13

Operating systems tested on:

Linux

Linked PRs

  • gh-131791: Improve speed of textwrap.dedent by replacing re #131792

Activity

  1. trivialkettle
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Mar 27, 2025
  2. graingert commented on Mar 27, 2025

    @graingert
    graingert
    on Mar 27, 2025
    Contributor
    More actions

    you configured logging.basicConfig(filename='myapp.log', level=logging.INFO) this means nothing will be printed, instead logs will be written to myapp.log

  3. ericvsmith commented on Mar 27, 2025

    @ericvsmith
    ericvsmith
    on Mar 27, 2025
    Member
    More actions

    As @graingert mentions, the output does show up in the file myapp.log.

    If this is a regression, then in what version of python did it produce output?

    I don't think there's a bug here, but if this did behave differently in a previous version of python that would be interesting.

  4. trivialkettle commented on Mar 27, 2025

    @trivialkettle
    trivialkettle
    on Mar 27, 2025
    Author
    More actions

    Ah sorry, you are right, I missed this.

    I had some strange issues, that I could not set the logger level, my code works on python 3.10 but not on 3.13.

    basically I do

        logging.basicConfig(stream=sys.stderr, level=args.log, format="%(asctime)s:" + logging.BASIC_FORMAT)
    ...
        class Foo:
            self._logger = logging.getLogger(self.__module__)
    
        def foo():
            self._logger.debug("foo")

    I try to reproduce this, maybe it was a glitch or something.

    Edit: I close it for now until I can reproduce this.

  5. trivialkettle
    closed this as completedon Mar 27, 2025
  6. ericvsmith
    closed this as not plannedon Mar 27, 2025
  7. ericvsmith
    added
    invalid
    and removed
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalid

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.