summaryrefslogtreecommitdiff
path: root/Lib/logging/__init__.py
Commit message (Collapse)AuthorAgeFilesLines
* 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-141-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-131-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
|
* bpo-33606: improve logging performance when logger is disabled (GH-7285)Timo Furrer2018-06-011-0/+3
| | | A check has been added in Logger.isEnabledFor() to return False when the logger is disabled. This avoids unnecessary work being done when a disabled logger is used.
* bpo-33400: Clarified documentation to indicate no strict adherence to ISO ↵Vinay Sajip2018-05-041-8/+9
| | | | 8601. (GH-6702)
* bpo-31457: Don't omit inner ``process()`` calls with nested LogAdapters (#4044)Łukasz Langa2017-10-191-1/+5
| | | | | | | | | | | This used to be the case on Python 2. Commit 212b590e118e3650b596917021ed9612a918180b changed the implementation for Python 3, making the `log()` method of LogAdapter call `logger._log()` directly. This makes nested log adapters not execute their ``process()`` method. This patch fixes the issue. Also, now proxying `name`, too, to make `repr()` work with nested log adapters. New tests added.
* bpo-31457: Make the `LoggerAdapter.manager` property settable (#4042)Łukasz Langa2017-10-181-1/+1
| | | | Due to a bug in the initial fix, the setter was in fact creating a different property. This is now fixed.
* bpo-31457: Allow for nested LoggerAdapter objects (#3551)Łukasz Langa2017-09-141-0/+21
| | | | | | Some of the proxied methods use internal Logger state which isn't proxied, causing failures if an adapter is applied to another adapter. This commit fixes the issue, adds a new test for the use case.
* bpo-31370: Remove support for threads-less builds (#3385)Antoine Pitrou2017-09-071-14/+4
| | | | | | * Remove Setup.config * Always define WITH_THREAD for compatibility.
* Updated LoggerAdapter.isEnabledFor to take advantage of caching. (GH-2951)Vinay Sajip2017-07-301-3/+1
|
* bpo-30522: Implemented a method to allow setting a logging.StreamHander's ↵Vinay Sajip2017-07-301-0/+20
| | | | stream. (GH-2921)
* bpo-30962: Added caching to Logger.isEnabledFor() (GH-2752)Avram Lubkin2017-07-301-3/+27
|
* bpo-30520: Implemented pickling for loggers. (#1956)Vinay Sajip2017-06-061-2/+13
| | | Implemented pickling for loggers.
* bpo-30144: Import collections ABC from collections.abc rather than ↵Serhiy Storchaka2017-04-241-3/+3
| | | | collections. (#1263)
* Issue #29220: Merged fixes from 3.6.Vinay Sajip2017-01-111-5/+6
|\
| * Issue #292Merged fixes from 3.5.Vinay Sajip2017-01-111-3/+8
| |\
| | * Issue #29220: Improved fix and test.Vinay Sajip2017-01-111-3/+8
| | |
| | * Fixes #27937: optimise code used in all logging calls.Vinay Sajip2016-09-031-4/+5
| | |
* | | Closes #29220: Fixed regression in logging.getLevelName().Vinay Sajip2017-01-111-3/+7
| | |
* | | Closes #28524: added default level for logging.disable().Vinay Sajip2016-12-311-1/+1
|/ /
* | Closes #27935: returned numeric value for 'FATAL' logging level.Vinay Sajip2016-09-031-0/+1
| |
* | Fixes #27937: optimise code used in all logging calls.Vinay Sajip2016-09-031-2/+3
| |
* | Closes #27650: Implemented repr methods for logging objects.Vinay Sajip2016-08-061-0/+27
| |
* | Closes #27493: accepted Path objects in file handlers for logging.Vinay Sajip2016-07-221-2/+4
| |
* | merge with 3.5Georg Brandl2016-02-251-2/+2
|\ \ | |/
| * Closes #26435: fix syntax in directives. Thanks to Jakub Stasiak.Georg Brandl2016-02-251-2/+2
| |
* | Issue #23883: Add missing APIs to __all__; patch by Jacek KołodziejMartin Panter2015-11-141-2/+3
|/
* Issue #23865: close() methods in multiple modules now are idempotent and moreSerhiy Storchaka2015-04-101-8/+13
|\ | | | | | | | | robust at shutdown. If needs to release multiple resources, they are released even if errors are occured.
| * Issue #23865: close() methods in multiple modules now are idempotent and moreSerhiy Storchaka2015-04-101-8/+13
| | | | | | | | | | robust at shutdown. If needs to release multiple resources, they are released even if errors are occured.
* | Issue #23207: merged fix from 3.4.Vinay Sajip2015-03-181-1/+1
|\ \ | |/
| * Issue #23207: Improved kwarg validation.Vinay Sajip2015-03-181-1/+1
| |