diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2022-10-16 08:15:46 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-16 08:15:46 (GMT) |
commit | f6b1e4048dc353aecfbfbae07de8212900632098 (patch) | |
tree | 1770437db09fd28bd51dbc7922a10bdead2bb21a /Lib/logging | |
parent | 7b48d02933639c91ebd957b2326d8c352d8eddec (diff) | |
download | cpython-f6b1e4048dc353aecfbfbae07de8212900632098.zip cpython-f6b1e4048dc353aecfbfbae07de8212900632098.tar.gz cpython-f6b1e4048dc353aecfbfbae07de8212900632098.tar.bz2 |
gh-98307: Add docstring and documentation for SysLogHandler.createSocket (GH-98319)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Diffstat (limited to 'Lib/logging')
-rw-r--r-- | Lib/logging/handlers.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index b4c5c13..9847104 100644 --- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -891,6 +891,13 @@ class SysLogHandler(logging.Handler): raise def createSocket(self): + """ + Try to create a socket and, if it's not a datagram socket, connect it + to the other end. This method is called during handler initialization, + but it's not regarded as an error if the other end isn't listening yet + --- the method will be called again when emitting an event, + if there is no socket at that point. + """ address = self.address socktype = self.socktype @@ -898,7 +905,7 @@ class SysLogHandler(logging.Handler): self.unixsocket = True # Syslog server may be unavailable during handler initialisation. # C's openlog() function also ignores connection errors. - # Moreover, we ignore these errors while logging, so it not worse + # Moreover, we ignore these errors while logging, so it's not worse # to ignore it also here. try: self._connect_unixsocket(address) |