| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
| |
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
|
|
|
|
| |
logging.handlers.MemoryHandler (GH-21765)
|
|
|
|
|
| |
Docs and tests are underway.
Automerge-Triggered-By: @vsajip
|
|
|
|
|
| |
(GH-20563)
Automerge-Triggered-By: @vsajip
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
| |
isEnabledFor (GH-17689)
|
|
|
|
|
|
|
| |
This uses the heuristic of assuming a named tuple is a subclass of
tuple with a _fields attribute. This change means that contents of
a named tuple wouldn't be converted - if a user wants to have
ConvertingTuple functionality from a namedtuple, they will have to
implement it themselves.
|
|
|
|
|
|
|
|
| |
This makes it easier to use a custom buffer when subclassing
MemoryHandler (by avoiding the explicity empty list literal
assignment in the flush method). For example, collection.deque
can now be used without any modifications to MemoryHandler.flush.
The same applies to BufferingHandler.
|
|
|
|
| |
to None (GH-17072)
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
(#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.
|
|
|
|
| |
(GH-14008)
|
| |
|
|
|
|
|
|
|
|
| |
Fixed QueueListener in order to avoid random deadlocks.
Unable to add regression tests atm due to time constraints, will add it in a bit.
Regarding implementation, although it's nested, it does not cause performance issues whatsoever, and does not call task_done() in case of an exception (which is the right thing to do IMHO).
https://bugs.python.org/issue36813
|
|
|
|
| |
(GH-11908)
|
|
|
|
|
| |
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.
|
|
|
|
| |
Classes that define __str__ the same as __repr__ can
just inherit it from object.
|
| |
|
|
|
|
|
| |
(GH-11537)
QueueHandler.prepare() now makes a copy of the record before modifying and enqueueing it, to avoid affecting other handlers in the chain.
|
| |
|
|
|
|
| |
matches in logging.Formatter (GH-9703)
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
|
|
| |
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.
|
|
|
|
| |
8601. (GH-6702)
|
|
|
|
| |
(GH-2624)
|
| |
|
| |
|
|
|
| |
TimedRotatingFileHandler.getFilesToDelete() now sorts only when needed.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Due to a bug in the initial fix, the setter was in fact creating a different
property. This is now fixed.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
The ConfigSocketReceiver.serve_until_stopped() method from
logging.config.listen() now calls server_close() (of
socketserver.ThreadingTCPServer) rather than closing manually the
socket.
While this change has no effect yet, it will help to prevent dangling
threads once ThreadingTCPServer.server_close() will join spawned
threads (bpo-31233).
|
|
|
|
|
|
| |
* Remove Setup.config
* Always define WITH_THREAD for compatibility.
|
|
|
|
| |
kwargs. (GH-2979)
|
| |
|
| |
|
|
|
|
| |
stream. (GH-2921)
|
| |
|
|
|
| |
Implemented pickling for loggers.
|
|
|
|
| |
(#1676)
|