8000 logging.info() triggers basicConfig() · Issue #332 · googleapis/python-storage · GitHub
[go: up one dir, main page]

Skip to content
logging.info() triggers basicConfig() #332
@kamilglod

Description

@kamilglod

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

. 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.

Metadata

Metadata

Assignees

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

    0