Commit graph

222 commits

Author SHA1 Message Date
Miss Islington (bot)
78dd781ef4 bpo-36015: Handle StreamHandler representaton of stream with an integer name (GH-11908) (GH-13183)
(cherry picked from commit ca87eebb22)

Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
2019-05-15 19:06:29 +01:00
Gregory P. Smith
3b4b28efbd
[3.7] bpo-36533: Reinit logging.Handler locks on fork(). (GH-12704) (GH-13170)
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.
(cherry picked from commit 64aa6d2000)

Co-authored-by: Gregory P. Smith <greg@krypto.org>  [Google LLC]
2019-05-07 16:29:41 -04:00
Miss Islington (bot)
6a7a9f1d83 bpo-36272: Logging now propagates RecursionError (GH-12312) (GH-12391)
(cherry picked from commit 65f64b1903)

Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
2019-03-18 14:22:41 +00:00
Miss Islington (bot)
d730719b09 bpo-35046: do only one system call per line (logging.StreamHandler) (GH-10042) (GH-10050)
(cherry picked from commit b7d62050e7)
2018-10-23 11:07:06 +01:00
Miss Islington (bot)
3b699932e5 bpo-6721: Hold logging locks across fork() (GH-4071) (#9291)
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.
(cherry picked from commit 19003841e9)

Co-authored-by: Gregory P. Smith <greg@krypto.org> [Google]
2018-10-07 00:09:59 -07:00
Miss Islington (bot)
2e4ae8f1b3 bpo-34415: Updated logging.Formatter docstring. (GH-8811) (GH-8817)
(cherry picked from commit d3d3171da8)
2018-08-19 08:20:13 +01:00
Miss Islington (bot)
eb8516becc bpo-33400: Clarified documentation to indicate no strict adherence to ISO 8601. (GH-6702) (GH-6704)
(cherry picked from commit c4994dc00d)

Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
2018-05-28 13:29:13 +01:00
Łukasz Langa
ce9e625445 bpo-31457: Don't omit inner `process()` calls with nested LogAdapters (#4044)
This used to be the case on Python 2.  Commit
212b590e11 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.
2017-10-19 10:24:55 -07:00
Łukasz Langa
0b6a118a45 bpo-31457: Make the LoggerAdapter.manager property settable (#4042)
Due to a bug in the initial fix, the setter was in fact creating a different
property.  This is now fixed.
2017-10-18 17:28:51 -07:00
Łukasz Langa
1bbd482bcf bpo-31457: Allow for nested LoggerAdapter objects (#3551)
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.
2017-09-14 11:34:47 -04:00
Antoine Pitrou
a6a4dc816d bpo-31370: Remove support for threads-less builds (#3385)
* Remove Setup.config
* Always define WITH_THREAD for compatibility.
2017-09-07 18:56:24 +02:00
Vinay Sajip
75f0b5dbac Updated LoggerAdapter.isEnabledFor to take advantage of caching. (GH-2951) 2017-07-30 20:15:18 +01:00
Vinay Sajip
2543f50033 bpo-30522: Implemented a method to allow setting a logging.StreamHander's stream. (GH-2921) 2017-07-30 10:41:45 +01:00
Avram Lubkin
78c18a9b9a bpo-30962: Added caching to Logger.isEnabledFor() (GH-2752) 2017-07-30 10:36:33 +01:00
Vinay Sajip
6260d9f203 bpo-30520: Implemented pickling for loggers. (#1956)
Implemented pickling for loggers.
2017-06-06 16:34:29 +01:00
Serhiy Storchaka
2e576f5aec bpo-30144: Import collections ABC from collections.abc rather than collections. (#1263) 2017-04-24 09:05:00 +03:00
Vinay Sajip
d4f5001bac Issue #29220: Merged fixes from 3.6. 2017-01-11 17:44:07 +00:00
Vinay Sajip
a861d48817 Issue #292Merged fixes from 3.5. 2017-01-11 17:41:28 +00:00
Vinay Sajip
924aaae4c2 Issue #29220: Improved fix and test. 2017-01-11 17:35:36 +00:00
Vinay Sajip
8b866d5429 Closes #29220: Fixed regression in logging.getLevelName(). 2017-01-11 06:57:55 +00:00
Vinay Sajip
d489ac9102 Closes #28524: added default level for logging.disable(). 2016-12-31 11:40:11 +00:00
Vinay Sajip
ab7b0a03b5 Fixes #27937: optimise code used in all logging calls. 2016-09-03 16:50:09 +01:00
Vinay Sajip
2500c98278 Closes #27935: returned numeric value for 'FATAL' logging level. 2016-09-03 17:04:36 +01:00
Vinay Sajip
0a7b7e30ff Fixes #27937: optimise code used in all logging calls. 2016-09-03 15:56:07 +01:00
Vinay Sajip
c075201147 Closes #27650: Implemented repr methods for logging objects. 2016-08-06 10:28:31 +01:00
Vinay Sajip
638e622055 Closes #27493: accepted Path objects in file handlers for logging. 2016-07-22 18:23:04 +01:00
Georg Brandl
6d6dd73aec merge with 3.5 2016-02-25 20:18:00 +01:00
Georg Brandl
8c16cb9f65 Closes #26435: fix syntax in directives. Thanks to Jakub Stasiak. 2016-02-25 20:17:45 +01:00
Martin Panter
19e69c5a20 Issue #23883: Add missing APIs to __all__; patch by Jacek Kołodziej 2015-11-14 12:46:42 +00:00
Serhiy Storchaka
2116b12da5 Issue #23865: close() methods in multiple modules now are idempotent and more
robust at shutdown. If needs to release multiple resources, they are released
even if errors are occured.
2015-04-10 13:29:28 +03:00
Serhiy Storchaka
7e7a3dba5f Issue #23865: close() methods in multiple modules now are idempotent and more
robust at shutdown. If needs to release multiple resources, they are released
even if errors are occured.
2015-04-10 13:24:41 +03:00
Vinay Sajip
3505bd82a9 Issue #23207: merged fix from 3.4. 2015-03-18 08:49:57 +00:00
Vinay Sajip
d55436ace3 Issue #23207: Improved kwarg validation. 2015-03-18 08:47:58 +00:00
Vinay Sajip
ecb5de3d5e Closes #23207: logging.basicConfig() now does additional validation of its arguments. 2015-01-23 19:54:23 +00:00
Vinay Sajip
5abca7023c Issue #23207: logging.basicConfig() now does additional validation of its arguments. 2015-01-23 19:52:21 +00:00
Vinay Sajip
02980426d0 Closes #21980: Added a __repr__ for LogRecord. 2015-01-06 11:19:42 +00:00
Vinay Sajip
2fb1efe4f4 Closes #23151: Removed unnecessary initialization. 2015-01-06 10:56:09 +00:00
Vinay Sajip
02a8f9e9ac Closes #20537: logging methods now accept an exception instance as well as a Boolean value or exception tuple. Thanks to Yury Selivanov for the patch. 2014-09-14 21:29:11 +01:00
Vinay Sajip
d1d4fbff63 Issue #22386: fixed regression. 2014-09-11 23:06:09 +01:00
Vinay Sajip
194bcaf4dc Issue #21709: Improved implementation to cover the frozen module case. 2014-06-12 23:36:33 +01:00
Vinay Sajip
80f2262dcf Issue #21709: Remove references to __file__ when part of a frozen application. 2014-06-11 08:01:32 +01:00
Vinay Sajip
1b7611405d Issue #21172: isinstance check relaxed from dict to collections.Mapping. 2014-04-10 07:12:19 +01:00
Vinay Sajip
156307bfd6 Issue #21149: Improved thread-safety in logging cleanup during interpreter shutdown. 2014-04-04 10:51:49 +01:00
Vinay Sajip
698abe75d4 Closes #20918: Added handling for exceptions during fallback output of logging exceptions. 2014-03-14 13:42:19 +00:00
Vinay Sajip
30e6a64e76 Closes #20242: Merged fix from 3.3. 2014-01-13 22:01:16 +00:00
Vinay Sajip
1fd1202072 Issue #20242: Fixed basicConfig() format strings for the alternative formatting styles. 2014-01-13 21:59:56 +00:00
Vinay Sajip
a76157dca6 Issue #19523: Closed FileHandler leak which occurred when delay was set. 2013-11-15 20:40:27 +00:00
Vinay Sajip
5e75829ec3 Closes #19523: Merged fix from 3.3. 2013-11-15 20:42:47 +00:00
Vinay Sajip
f7b436ce8d Closes #18941: Merged fix from 3.3. 2013-09-06 10:26:48 +01:00
Vinay Sajip
43c6ef1899 Issue #18941: Respected delay when doing rollover. 2013-09-06 10:25:31 +01:00