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 — logging.info() triggers basicConfig() · Issue #332 · googleapis/python-storage

This repository was archived by the owner on Mar 31, 2026. It is now read-only.
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

logging.info() triggers basicConfig() #332

Copy link
Copy link
Closed
#333
Closed
logging.info() triggers basicConfig()#332
#333
Copy link
Assignees
tseaver
Labels
api: clouddebuggerIssues related to the Stackdriver Debugger API.api: storageIssues related to the googleapis/python-storage API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.

Description

@kamilglod
kamilglod
opened on Dec 1, 2020
Issue body actions

When I use download_as_string() method or similar, logging.root logger is being activated by calling logging.info() on line

python-storage/google/cloud/storage/blob.py

Line 926 in 63ff233

logging.info(msg)
. It causes other loggers to be logged by the root logger which is unexpected as some apps require a single logger in strict format.

Environment details

  • OS type and version: ubuntu 20.04
  • Python version: 3.8.6
  • pip version: 20.2.4
  • google-cloud-storage version: 1.33.0

Steps to reproduce

  1. set up your own logger for any logger
  2. call logger.info("test") (nothing should happen)
  3. run Client.from_service_account_json().get_bucket(...).blob(..., chunk_size=1024*1024).download_as_string()
  4. call logger.info("test") one more time
  5. log in basic format should appear on stdout (unexpected)

How to fix it

you need to use your own logger (e.g. using logging.getLogger(__name__) instead of root logger.

Reacted by Jacek Jabłoński and Marek Bielecki

Activity

  1. product-auto-label
    added
    api: storageIssues related to the googleapis/python-storage API.
    on Dec 1, 2020
  2. tseaver
    self-assigned this
    on Dec 1, 2020
  3. tseaver
    added
    api: clouddebuggerIssues related to the Stackdriver Debugger API.
    priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.
    on Dec 1, 2020
  4. tseaver commented on Dec 1, 2020

    @tseaver
    tseaver
    on Dec 1, 2020
    Contributor
    More actions

    Bug injected in PR #246.

  5. tseaver
    added a commit that references this issue on Dec 1, 2020

    fix: avoid triggering global logging config

    This issue will close once commit 786cb97 is merged into the 'main' branch.
    786cb97
  6. tseaver commented on Dec 1, 2020

    @tseaver
    tseaver
    on Dec 1, 2020
    Contributor
    More actions

    @kamilglod Thanks very much for the report!

  7. andrewsg
    closed this as completedin #333on Dec 1, 2020
  8. andrewsg
    added a commit that references this issue on Dec 1, 2020

    fix: avoid triggering global logging config (#333)

    This issue will close once commit 602108a is merged into the 'main' branch.
    602108a
  9. cojenco
    added 2 commits that reference this issue on Oct 13, 2021

    fix: avoid triggering global logging config (googleapis#333)

    This issue will close once commit 4f31f99 is merged into the 'main' branch.
    4f31f99

    fix: avoid triggering global logging config (googleapis#333)

    This issue will close once commit 75dbd94 is merged into the 'main' branch.
    75dbd94
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @tseaver
    tseaver

Labels

api: clouddebuggerIssues related to the Stackdriver Debugger API.api: storageIssues related to the googleapis/python-storage API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — 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.