[issue33165] Add stacklevel parameter to logging APIs

2019-12-27 Thread Evandro Coan


Change by Evandro Coan :


--
pull_requests: +17159
pull_request: https://github.com/python/cpython/pull/17714

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33165] Add stacklevel parameter to logging APIs

2018-06-05 Thread Vinay Sajip


Change by Vinay Sajip :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33165] Add stacklevel parameter to logging APIs

2018-06-05 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset dde9fdbe453925279ac3d2a6a72102f6f9ef247c by Vinay Sajip in branch 
'master':
bpo-33165: Added stacklevel parameter to logging APIs. (GH-7424)
https://github.com/python/cpython/commit/dde9fdbe453925279ac3d2a6a72102f6f9ef247c


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33165] Add stacklevel parameter to logging APIs

2018-06-05 Thread Vinay Sajip


Change by Vinay Sajip :


--
keywords: +patch
pull_requests: +7049
stage: needs patch -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33165] Add stacklevel parameter to logging APIs

2018-03-28 Thread Nick Coghlan

New submission from Nick Coghlan :

warnings.warn() offers a stacklevel parameter to make it easier to write helper 
functions that generate warnings - by passing "stacklevel=2", you can ensure 
the warning is attributed to the caller of the helper function, rather than to 
the helper function itself.

There isn't currently a similarly clear way to write helper functions that emit 
logging messages - if the format includes "pathname", "filename", "module", 
"function", or "lineno", then those will always report the location of the 
helper function, rather than the caller of the helper function.

It would be convenient if logging.debug() et al accepted a "stacklevel" 
parameter the same way the warnings module does (although this may require some 
adjustments to the Logger.findCaller method API)

--
components: Library (Lib)
messages: 314578
nosy: ncoghlan, vinay.sajip
priority: normal
severity: normal
stage: needs patch
status: open
title: Add stacklevel parameter to logging APIs
type: enhancement
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com