Project

Profile

Help

Issue #8499

closed

pulpcore warnings are not seen by anyone

Added by bmbouter over 3 years ago. Updated over 3 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

Problem

Currently warnings are implemented with warnings.warn which is not being shown in the logs.

#python pointed me to this interesting section of the docs contrasting warning.warn() vs logging.warning() which suggests warning.warn is right, but then in the channel 3+ well-known python folks said that even though Python has DeprecatedWarning we shouldn't use it because in practice no one see's it. In order to see it users would have to run Python -Wall which is not practical or in some cases possible, e.g. we aren't in control of how the /usr/bin/rq binary calls Python.

Ultimately our goal with these warnings was to have both users AND developers see them. To do that, the devs in #python recommended we switch to logging.warning().

Fix

  1. Create a new logger that can be used by plugin writers to log at the warning level.
  2. Port the existing usage to use this new deprecated logger.
  3. Update the plugin writer docs also.

Why another logger?

It allows a system, e.g. a downstream system, to disable the deprecation warnings while still retaining other normal application warnings.

Actions #1

Updated by bmbouter over 3 years ago

  • Description updated (diff)
Actions #2

Updated by bmbouter over 3 years ago

  • Description updated (diff)
Actions #3

Updated by bmbouter over 3 years ago

  • Description updated (diff)
Actions #4

Updated by bmbouter over 3 years ago

  • Subject changed from pulpcore warnings are not seen by users to pulpcore warnings are not seen by anyone
Actions #5

Updated by bmbouter over 3 years ago

  • Description updated (diff)
Actions #6

Updated by bmbouter over 3 years ago

  • Description updated (diff)
Actions #7

Updated by bmbouter over 3 years ago

  • Status changed from NEW to POST
  • Assignee set to daviddavis
Actions #9

Updated by daviddavis over 3 years ago

  • Sprint/Milestone set to 3.12.0

I think this needs to go out with 3.12 since we added some new deprecation warnings.

Added by daviddavis over 3 years ago

Revision 35438388 | View on GitHub

Fixed bug where deprecation warnings weren't being logged

fixes #8499

Actions #10

Updated by daviddavis over 3 years ago

  • Status changed from POST to MODIFIED
Actions #11

Updated by pulpbot over 3 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF