summaryrefslogtreecommitdiffstats
path: root/Lib/logging/__init__.py
Commit message (Collapse)AuthorAgeFilesLines
* gh-109461: Update logging module lock to use context manager (#109462)Dale Collison2023-09-271-91/+45
| | | Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-76913: Add "merge extras" feature to LoggerAdapter (GH-107292)Romuald Brunet2023-08-151-2/+16
|
* gh-107710: Speed up `logging.getHandlerNames` function (#107711)Nikita Sobolev2023-08-071-2/+1
|
* gh-102799: replace internal sys.exc_info() call by sys.exception() (#106746)Irit Katriel2023-07-141-5/+5
|
* gh-105376: Remove logging.warn() and LoggerAdapter.warn() (#106553)Victor Stinner2023-07-091-11/+1
|
* gh-106238: Handle KeyboardInterrupt during logging._acquireLock() (GH-106239)Ariel Eizenberg2023-07-061-1/+5
| | | Co-authored-by: Ariel Eizenberg <ariel.eizenberg@pagaya.com>
* gh-105376: Remove logging.Logger.warn() method (#105377)Victor Stinner2023-06-061-5/+0
|
* gh-102799: use exception instance instead of sys.exc_info() (#102885)Irit Katriel2023-03-311-2/+2
|
* gh-99811: Use correct variable to search for time in format string (GH-99812)cemysce2022-11-281-1/+1
| | | Use correct variable to search for asctime
* gh-89258: Add a getChildren() method to logging.Logger. (GH-96444)Vinay Sajip2022-08-311-0/+19
| | | Co-authored-by: Éric <merwok@netwok.org>
* gh-89047: Fix msecs computation so you never end up with 1000 msecs. (GH-96340)Vinay Sajip2022-08-271-1/+1
|
* gh-95804: Respect MemoryHandler.flushOnClose in logging shutdown. (GH-95857)David Bonner2022-08-101-1/+5
|
* gh-95454: Replace truthy/falsy with true/false (GH-95456)Robert O'Shea2022-07-301-6/+6
|
* gh-92592: Allow logging filters to return a LogRecord. (GH-92591)Adrian Garcia Badaracco2022-06-071-10/+33
|
* gh-93162: Add ability to configure QueueHandler/QueueListener together ↵Vinay Sajip2022-06-071-3/+21
| | | | | | | (GH-93269) Also, provide getHandlerByName() and getHandlerNames() APIs. Closes #93162.
* [doc] Correct a grammatical error in a docstring. (GH-93441)Colin Delahunty2022-06-041-1/+1
|
* gh-91513: Add 'asyncio' taskName to logging LogRecord attributes. (GH-93193)jackh-ncl2022-05-261-3/+18
|
* Delete outdated comment in logging module (#31117)Thomas Miedema2022-05-021-2/+0
| | | | | | The root logger is now accessible via its name, see https://github.com/python/cpython/pull/15077 Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-92128: Add `__class_getitem__` to `logging.LoggerAdapter` and ↵Alex Waygood2022-05-021-0/+5
| | | | | `logging.StreamHandler` (#92129) Closes #92128
* bpo-45171: Remove tests of deprecated logger.warn(). (GH-32139)Jouke Witteveen2022-03-271-1/+1
|
* bpo-45171: Fix stacklevel handling in logging. (GH-28287)Jouke Witteveen2022-03-271-32/+35
|
* bpo-46557: Log captured warnings without format string (GH-30975)Michael P. Nitowski2022-03-151-1/+3
|
* bpo-42378: fixed log truncation on logging shutdown (GH-27310)andrei kulakov2021-07-251-2/+11
| | | Automerge-Triggered-By: GH:vsajip
* bpo-43858: Add logging.getLevelNamesMapping() (GH-26459)andrei kulakov2021-06-031-1/+4
| | | Added a function that returns a copy of a dict of logging levels.
* bpo-44222: Improve _removeHandlerRef() for a very long _handlerList (GH-26325)Yonatan Goldschmidt2021-05-251-2/+3
| | | | | | The list lookups become a big burden for very long lists. This patch changes the "happy flow" path of 2 lookups into 1 lookup. Automerge-Triggered-By: GH:vsajip
* bpo-43651: PEP 597: Fix EncodingWarning in some tests (GH-25189)Inada Naoki2021-04-061-1/+5
| | | | | | | | | | | | * Fix _sitebuiltins * Fix test_inspect * Fix test_interpreters * Fix test_io * Fix test_iter * Fix test_json * Fix test_linecache * Fix test_lltrace * Fix test_logging * Fix logging
* bpo-43353: Document that logging.getLevelName() accepts string ↵Mariusz Felisiak2021-03-081-2/+6
| | | | | | | representation of logging level. (GH-24693) [bpo-43353]() Automerge-Triggered-By: GH:vsajip
* bpo-42644: Validate values in logging.disable() (#23786)Matthias Bussonnier2020-12-161-0/+8
| | | | | | | | | | | | | | | | | | | * bpo-42644: Validate values in logging.disable() Technically make the value of manager a property that checks and convert values assigned to it properly. This has the side effect of making `logging.disable` also accept strings representing the various level of warnings. We want to validate the type of the disable attribute at assignment time, as it is later compared to other levels when emitting warnings and would generate a `TypeError: '>=' not supported between ....` in a different part of the code base, which can make it difficult to track down. When assigned an incorrect value; it will raise a TypeError when the wrong type, or ValueError if an invalid str. Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-26789: Fix logging.FileHandler._open() at exit (GH-23053)Victor Stinner2020-11-021-2/+7
| | | | | | | | | | | | | | | | | | | The logging.FileHandler class now keeps a reference to the builtin open() function to be able to open or reopen the file during Python finalization. Fix errors like: Exception ignored in: (...) Traceback (most recent call last): (...) File ".../logging/__init__.py", line 1463, in error File ".../logging/__init__.py", line 1577, in _log File ".../logging/__init__.py", line 1587, in handle File ".../logging/__init__.py", line 1649, in callHandlers File ".../logging/__init__.py", line 948, in handle File ".../logging/__init__.py", line 1182, in emit File ".../logging/__init__.py", line 1171, in _open NameError: name 'open' is not defined
* bpo-42011: Update documentation of logging.Filter.filter() (GH-22692)Necdet Can Atesman2020-10-161-2/+2
|
* Delete extra 'the' from `Formatter` class docstring (GH-22530)Hansraj Das2020-10-041-1/+1
|
* Fix logging error message (GH-22410)Eric Larson2020-09-251-1/+2
| | | | | Same changes as #22276 squashed to a single commit. Just hoping to get Travis to cooperate by opening a new PR... Automerge-Triggered-By: @vsajip
* bpo-40884: Added defaults parameter for logging.Formatter (GH-20668)Bar Harel2020-06-181-8/+22
| | | | | Docs and tests are underway. Automerge-Triggered-By: @vsajip
* bpo-40836: Add docstring to logging.fatal() and logging.Logger.fatal() ↵Rémi Lapeyre2020-06-151-2/+10
| | | | | (GH-20563) Automerge-Triggered-By: @vsajip
* bpo-40756: Default second argument of LoggerAdapter.__init__ to None (GH-20362)Arturo Escaip2020-05-261-1/+1
| | | | | | | | | | | | | | | | | | | | | The 'extra' argument is not always used by custom logger adapters. For example: ```python class IndentAdapter(logging.LoggerAdapter): def process(self, msg, kwargs): indent = kwargs.pop(indent, 1) return ' ' * indent + msg, kwargs ``` It is cleaner and friendlier to default the 'extra' argument to None instead of either forcing the subclasses of LoggerAdapter to pass a None value directly or to override the constructor. This change is backward compatible because existing calls to `LoggerAdapter.__init__` are already passing a value for the second argument. Automerge-Triggered-By: @vsajip
* bpo-40300: Allow empty logging.Formatter.default_msec_format. (GH-19551)Mariusz Felisiak2020-04-171-2/+3
|
* bpo-40091: Fix a hang at fork in the logging module (GH-19416)Victor Stinner2020-04-131-12/+12
| | | | | | | Fix a hang at fork in the logging module: the new private _at_fork_reinit() method is now used to reinitialize locks at fork in the child process. The createLock() method is no longer used at fork.
* bpo-39198: Ensure logging global lock is released on exception in ↵Derek Brown2020-01-071-6/+9
| | | | isEnabledFor (GH-17689)
* bpo-37742: Return the root logger when logging.getLogger('root') is c… ↵Vinay Sajip2019-08-021-3/+2
| | | | | | | | (#15077) * bpo-37742: Return the root logger when logging.getLogger('root') is called. * Added type check guard on logger name in logging.getLogger() and refined a test.
* bpo-37111: Add 'encoding' and 'errors' parameters to logging.basicCon… ↵Vinay Sajip2019-06-171-8/+26
| | | | (GH-14008)
* bpo-36015: Handle StreamHandler representaton of stream with an integer name ↵Riccardo Magliocchetti2019-05-071-0/+2
| | | | (GH-11908)
* bpo-36533: Reinit logging.Handler locks on fork(). (GH-12704)Gregory P. Smith2019-05-071-36/+25
| | | | | Instead of attempting to acquire and release them all across fork which was leading to deadlocks in some applications that had chained their own handlers while holding multiple locks.
* bpo-36793: Remove unneeded __str__ definitions. (GH-13081)Serhiy Storchaka2019-05-061-3/+1
| | | | Classes that define __str__ the same as __repr__ can just inherit it from object.
* bpo-36272: Logging now propagates RecursionError (GH-12312)Rémi Lapeyre2019-03-151-0/+4
|
* bpo-35046: do only one system call per line (logging.StreamHandler) (GH-10042)Josh Snyder2018-10-231-2/+2
|
* bpo-34844: logging.Formatter enhancement - Ensure style and format string ↵BNMetrics2018-10-151-5/+63
| | | | matches in logging.Formatter (GH-9703)
* bpo-6721: Hold logging locks across fork() (GH-4071)Gregory P. Smith2018-09-141-0/+50
| | | | | | | | | bpo-6721: When os.fork() was called while another thread holds a logging lock, the child process may deadlock when it tries to log. This fixes that by acquiring all logging locks before fork and releasing them afterwards. A regression test that fails before this change is included. Within the new unittest itself: There is a small _potential_ due to mixing of fork and a thread in the child process if the parent's thread happened to hold a non-reentrant library call lock (malloc?) when the os.fork() happens. buildbots and time will tell if this actually manifests itself in this test or not. :/ A functionality test that avoids that would be a challenge. An alternate test that isn't trying to produce the deadlock itself but just checking that the release and acquire calls are made would be the next best alternative if so.
* bpo-34415: Updated logging.Formatter docstring. (GH-8811)Vinay Sajip2018-08-191-1/+2
|
* bpo-33897: Add a 'force' keyword argument to logging.basicConfig(). (GH-7873)Dong-hee Na2018-06-251-2/+14
|
* bpo-33165: Added stacklevel parameter to logging APIs. (GH-7424)Vinay Sajip2018-06-051-3/+10
|