From 627d5f18412a7e5848210c196637b3899383d8f6 Mon Sep 17 00:00:00 2001 From: Ronald Oussoren Date: Wed, 3 Feb 2021 21:29:15 +0100 Subject: [PATCH 1/8] bpo-43120: Add a number of LOG_* constants to syslog This adds a number of syslog facilities to the syslogmodule.c. These values are available on macOS. --- Doc/library/syslog.rst | 7 ++++- .../2021-02-03-21-26-57.bpo-43120.4fbCBl.rst | 2 ++ Modules/syslogmodule.c | 26 ++++++++++++++++++- 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2021-02-03-21-26-57.bpo-43120.4fbCBl.rst diff --git a/Doc/library/syslog.rst b/Doc/library/syslog.rst index d264a3340c98b0..1816bcb3cc03a8 100644 --- a/Doc/library/syslog.rst +++ b/Doc/library/syslog.rst @@ -90,7 +90,12 @@ Facilities: :const:`LOG_AUTH`, :const:`LOG_LPR`, :const:`LOG_NEWS`, :const:`LOG_UUCP`, :const:`LOG_CRON`, :const:`LOG_SYSLOG`, :const:`LOG_LOCAL0` to :const:`LOG_LOCAL7`, and, if defined in ````, - :const:`LOG_AUTHPRIV`. + :const:`LOG_AUTHPRIV`, :const:`LOG_FTP`, :const:`LOG_NETINFO`, + :const:`LOG_REMOTEAUTH`, :const:`LOG_INSTALL`, :const:`LOG_RAS`. + + .. versionchanged:: 3.10 + Added :const:`LOG_NETINFO`, :const:`LOG_REMOTEAUTH`, :const:`LOG_INSTALL`, + :const:`LOG_RAS`, and :const:`LOG_LAUNCHD`. Log options: :const:`LOG_PID`, :const:`LOG_CONS`, :const:`LOG_NDELAY`, and, if defined diff --git a/Misc/NEWS.d/next/Library/2021-02-03-21-26-57.bpo-43120.4fbCBl.rst b/Misc/NEWS.d/next/Library/2021-02-03-21-26-57.bpo-43120.4fbCBl.rst new file mode 100644 index 00000000000000..bb8b1e133eaf3f --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-02-03-21-26-57.bpo-43120.4fbCBl.rst @@ -0,0 +1,2 @@ +Added :const:`LOG_NETINFO`, :const:`LOG_REMOTEAUTH`, :const:`LOG_INSTALL`, +:const:`LOG_RAS`, and :const:`LOG_LAUNCHD` tot the :mod:`syslog` module. diff --git a/Modules/syslogmodule.c b/Modules/syslogmodule.c index cdc94a60a373d7..e566f21dfe5b8a 100644 --- a/Modules/syslogmodule.c +++ b/Modules/syslogmodule.c @@ -333,6 +333,30 @@ syslog_exec(PyObject *module) ADD_INT_MACRO(module, LOG_AUTHPRIV); #endif +#ifdef LOG_FTP + ADD_INT_MACRO(module, LOG_FTP); +#endif + +#ifdef LOG_NETINFO + ADD_INT_MACRO(module, LOG_NETINFO); +#endif + +#ifdef LOG_REMOTEAUTH + ADD_INT_MACRO(module, LOG_REMOTEAUTH); +#endif + +#ifdef LOG_INSTALL + ADD_INT_MACRO(module, LOG_INSTALL); +#endif + +#ifdef LOG_RAS + ADD_INT_MACRO(module, LOG_RAS); +#endif + +#ifdef LOG_LAUNCHD + ADD_INT_MACRO(module, LOG_LAUNCHD); +#endif + return 0; } @@ -355,4 +379,4 @@ PyMODINIT_FUNC PyInit_syslog(void) { return PyModuleDef_Init(&syslogmodule); -} \ No newline at end of file +} From 9ec667abc7804ffe04394d475eb5c92fb0b97656 Mon Sep 17 00:00:00 2001 From: Ronald Oussoren Date: Thu, 7 Dec 2023 16:57:42 +0100 Subject: [PATCH 2/8] Minor updates to bring this PR back to live --- Doc/library/syslog.rst | 6 +++--- .../next/Library/2021-02-03-21-26-57.bpo-43120.4fbCBl.rst | 2 -- .../Library/2023-12-07-16-55-41.gh-issue-24432.MILC9_.rst | 3 +++ 3 files changed, 6 insertions(+), 5 deletions(-) delete mode 100644 Misc/NEWS.d/next/Library/2021-02-03-21-26-57.bpo-43120.4fbCBl.rst create mode 100644 Misc/NEWS.d/next/Library/2023-12-07-16-55-41.gh-issue-24432.MILC9_.rst diff --git a/Doc/library/syslog.rst b/Doc/library/syslog.rst index 1816bcb3cc03a8..0070a4ed0e7b38 100644 --- a/Doc/library/syslog.rst +++ b/Doc/library/syslog.rst @@ -93,9 +93,9 @@ Facilities: :const:`LOG_AUTHPRIV`, :const:`LOG_FTP`, :const:`LOG_NETINFO`, :const:`LOG_REMOTEAUTH`, :const:`LOG_INSTALL`, :const:`LOG_RAS`. - .. versionchanged:: 3.10 - Added :const:`LOG_NETINFO`, :const:`LOG_REMOTEAUTH`, :const:`LOG_INSTALL`, - :const:`LOG_RAS`, and :const:`LOG_LAUNCHD`. + .. versionchanged:: 3.13 + Added :const:`LOG_FTP`, :const:`LOG_NETINFO`, :const:`LOG_REMOTEAUTH`, + :const:`LOG_INSTALL`, :const:`LOG_RAS`, and :const:`LOG_LAUNCHD`. Log options: :const:`LOG_PID`, :const:`LOG_CONS`, :const:`LOG_NDELAY`, and, if defined diff --git a/Misc/NEWS.d/next/Library/2021-02-03-21-26-57.bpo-43120.4fbCBl.rst b/Misc/NEWS.d/next/Library/2021-02-03-21-26-57.bpo-43120.4fbCBl.rst deleted file mode 100644 index bb8b1e133eaf3f..00000000000000 --- a/Misc/NEWS.d/next/Library/2021-02-03-21-26-57.bpo-43120.4fbCBl.rst +++ /dev/null @@ -1,2 +0,0 @@ -Added :const:`LOG_NETINFO`, :const:`LOG_REMOTEAUTH`, :const:`LOG_INSTALL`, -:const:`LOG_RAS`, and :const:`LOG_LAUNCHD` tot the :mod:`syslog` module. diff --git a/Misc/NEWS.d/next/Library/2023-12-07-16-55-41.gh-issue-24432.MILC9_.rst b/Misc/NEWS.d/next/Library/2023-12-07-16-55-41.gh-issue-24432.MILC9_.rst new file mode 100644 index 00000000000000..bfeec3c95207cb --- /dev/null +++ b/Misc/NEWS.d/next/Library/2023-12-07-16-55-41.gh-issue-24432.MILC9_.rst @@ -0,0 +1,3 @@ +Added :const:`LOG_FTP`, :const:`LOG_NETINFO`, :const:`LOG_REMOTEAUTH`, +:const:`LOG_INSTALL`, :const:`LOG_RAS`, and :const:`LOG_LAUNCHD` tot the +:mod:`syslog` module, all of them constants on used on macOS. From 2d2178f5c7704045ba5b309f8afa725c31885f25 Mon Sep 17 00:00:00 2001 From: Ronald Oussoren Date: Thu, 7 Dec 2023 17:06:13 +0100 Subject: [PATCH 3/8] Fixes * Fix patchcheck errors * Rename NEWS.d entry to the right name (issue# istead of PR#) --- Doc/library/syslog.rst | 4 ++-- ...LC9_.rst => 2023-12-07-16-55-41.gh-issue-87286.MILC9_.rst} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename Misc/NEWS.d/next/Library/{2023-12-07-16-55-41.gh-issue-24432.MILC9_.rst => 2023-12-07-16-55-41.gh-issue-87286.MILC9_.rst} (100%) diff --git a/Doc/library/syslog.rst b/Doc/library/syslog.rst index 74ac21d454b748..d7387a9f1a4045 100644 --- a/Doc/library/syslog.rst +++ b/Doc/library/syslog.rst @@ -117,11 +117,11 @@ Facilities: :const:`LOG_AUTH`, :const:`LOG_LPR`, :const:`LOG_NEWS`, :const:`LOG_UUCP`, :const:`LOG_CRON`, :const:`LOG_SYSLOG`, :const:`LOG_LOCAL0` to :const:`LOG_LOCAL7`, and, if defined in ````, - :const:`LOG_AUTHPRIV`, :const:`LOG_FTP`, :const:`LOG_NETINFO`, + :const:`LOG_AUTHPRIV`, :const:`LOG_FTP`, :const:`LOG_NETINFO`, :const:`LOG_REMOTEAUTH`, :const:`LOG_INSTALL`, :const:`LOG_RAS`. .. versionchanged:: 3.13 - Added :const:`LOG_FTP`, :const:`LOG_NETINFO`, :const:`LOG_REMOTEAUTH`, + Added :const:`LOG_FTP`, :const:`LOG_NETINFO`, :const:`LOG_REMOTEAUTH`, :const:`LOG_INSTALL`, :const:`LOG_RAS`, and :const:`LOG_LAUNCHD`. Log options: diff --git a/Misc/NEWS.d/next/Library/2023-12-07-16-55-41.gh-issue-24432.MILC9_.rst b/Misc/NEWS.d/next/Library/2023-12-07-16-55-41.gh-issue-87286.MILC9_.rst similarity index 100% rename from Misc/NEWS.d/next/Library/2023-12-07-16-55-41.gh-issue-24432.MILC9_.rst rename to Misc/NEWS.d/next/Library/2023-12-07-16-55-41.gh-issue-87286.MILC9_.rst From d2f38a04b37075455c0c6ec501d324e6c00136cd Mon Sep 17 00:00:00 2001 From: Ronald Oussoren Date: Fri, 8 Dec 2023 13:01:01 +0100 Subject: [PATCH 4/8] Switch contant documentation to the data directive This fixes a CI warning and matches the pattern used in the documentation for ``os``. --- Doc/library/syslog.rst | 67 ++++++++++++++++++++++++++++++++---------- 1 file changed, 51 insertions(+), 16 deletions(-) diff --git a/Doc/library/syslog.rst b/Doc/library/syslog.rst index d7387a9f1a4045..d1dc74de7ada26 100644 --- a/Doc/library/syslog.rst +++ b/Doc/library/syslog.rst @@ -107,27 +107,62 @@ The module defines the following functions: The module defines the following constants: -Priority levels (high to low): - :const:`LOG_EMERG`, :const:`LOG_ALERT`, :const:`LOG_CRIT`, :const:`LOG_ERR`, - :const:`LOG_WARNING`, :const:`LOG_NOTICE`, :const:`LOG_INFO`, - :const:`LOG_DEBUG`. - -Facilities: - :const:`LOG_KERN`, :const:`LOG_USER`, :const:`LOG_MAIL`, :const:`LOG_DAEMON`, - :const:`LOG_AUTH`, :const:`LOG_LPR`, :const:`LOG_NEWS`, :const:`LOG_UUCP`, - :const:`LOG_CRON`, :const:`LOG_SYSLOG`, :const:`LOG_LOCAL0` to - :const:`LOG_LOCAL7`, and, if defined in ````, - :const:`LOG_AUTHPRIV`, :const:`LOG_FTP`, :const:`LOG_NETINFO`, - :const:`LOG_REMOTEAUTH`, :const:`LOG_INSTALL`, :const:`LOG_RAS`. + +.. data:: LOG_EMERG + LOG_ALERT + LOG_CRIT + LOG_ERR + LOG_WARNING + LOG_NOTICE + LOG_INFO + LOG_DEBUG + + Priority levels (high to low): + + +.. data:: LOG_AUTH + LOG_AUTHPRIV + LOG_CRON + LOG_DAEMON + LOG_FTP + LOG_INSTALL + LOG_KERN + LOG_LAUNCHD + LOG_LPR + LOG_MAIL + LOG_NETINFO + LOG_NEWS + LOG_RAS + LOG_REMOTEAUTH + LOG_SYSLOG + LOG_USER + LOG_UUCP + LOG_LOCAL0 + LOG_LOCAL1 + LOG_LOCAL2 + LOG_LOCAL3 + LOG_LOCAL4 + LOG_LOCAL5 + LOG_LOCAL6 + LOG_LOCAL7 + + Facilities, depending on availabiltiy in ```` for :const:`LOG_AUTHPRIV`, + :const:`LOG_FTP`, :const:`LOG_NETINFO`, :const:`LOG_REMOTEAUTH`, + :const:`LOG_INSTALL` and :const:`LOG_RAS`. .. versionchanged:: 3.13 Added :const:`LOG_FTP`, :const:`LOG_NETINFO`, :const:`LOG_REMOTEAUTH`, :const:`LOG_INSTALL`, :const:`LOG_RAS`, and :const:`LOG_LAUNCHD`. -Log options: - :const:`LOG_PID`, :const:`LOG_CONS`, :const:`LOG_NDELAY`, and, if defined - in ````, :const:`LOG_ODELAY`, :const:`LOG_NOWAIT`, and - :const:`LOG_PERROR`. +.. data:: LOG_PID + LOG_CONS + LOG_NDELAY + LOG_ODELAY + LOG_NOWAIT + LOG_PERROR + + Log options, depending on availability in ```` for + :const:`LOG_ODELAY`, :const:`LOG_NOWAIT` and :const:`LOG_PERROR`. Examples From 73ce779e7ec5675415bb84d176ae9d43fea4ca9e Mon Sep 17 00:00:00 2001 From: Ronald Oussoren Date: Fri, 8 Dec 2023 13:33:43 +0100 Subject: [PATCH 5/8] Update Doc/library/syslog.rst Co-authored-by: Hugo van Kemenade --- Doc/library/syslog.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/syslog.rst b/Doc/library/syslog.rst index d1dc74de7ada26..02fdcc8dd3c90f 100644 --- a/Doc/library/syslog.rst +++ b/Doc/library/syslog.rst @@ -117,7 +117,7 @@ The module defines the following constants: LOG_INFO LOG_DEBUG - Priority levels (high to low): + Priority levels (high to low). .. data:: LOG_AUTH From a0f6b286de5e47c7e116f8ed7615367ab4720a1a Mon Sep 17 00:00:00 2001 From: Ronald Oussoren Date: Fri, 8 Dec 2023 13:33:52 +0100 Subject: [PATCH 6/8] Update Doc/library/syslog.rst Co-authored-by: Hugo van Kemenade --- Doc/library/syslog.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/syslog.rst b/Doc/library/syslog.rst index 02fdcc8dd3c90f..3aa2ac1fb5b483 100644 --- a/Doc/library/syslog.rst +++ b/Doc/library/syslog.rst @@ -124,7 +124,7 @@ The module defines the following constants: LOG_AUTHPRIV LOG_CRON LOG_DAEMON - LOG_FTP + LOG_FTP LOG_INSTALL LOG_KERN LOG_LAUNCHD From 43f1854a74a16755f154521fb15bda095a735af9 Mon Sep 17 00:00:00 2001 From: Ronald Oussoren Date: Fri, 8 Dec 2023 13:44:15 +0100 Subject: [PATCH 7/8] Fix last sphinx markup warning in syslog documetation --- Doc/library/syslog.rst | 2 +- Doc/tools/.nitignore | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Doc/library/syslog.rst b/Doc/library/syslog.rst index 3aa2ac1fb5b483..488857d08ff8ed 100644 --- a/Doc/library/syslog.rst +++ b/Doc/library/syslog.rst @@ -15,7 +15,7 @@ facility. This module wraps the system ``syslog`` family of routines. A pure Python library that can speak to a syslog server is available in the -:mod:`logging.handlers` module as :class:`SysLogHandler`. +:mod:`logging.handlers` module as :class:`~logging.handlers.SysLogHandler`. The module defines the following functions: diff --git a/Doc/tools/.nitignore b/Doc/tools/.nitignore index ada1fc5fafc9c9..f9b9e22abb532a 100644 --- a/Doc/tools/.nitignore +++ b/Doc/tools/.nitignore @@ -95,7 +95,6 @@ Doc/library/ssl.rst Doc/library/stdtypes.rst Doc/library/string.rst Doc/library/subprocess.rst -Doc/library/syslog.rst Doc/library/tarfile.rst Doc/library/tempfile.rst Doc/library/termios.rst From f273c42649dffbe426f27770da9ee1a886da7836 Mon Sep 17 00:00:00 2001 From: Ronald Oussoren Date: Fri, 8 Dec 2023 14:02:48 +0100 Subject: [PATCH 8/8] Update Doc/library/syslog.rst Co-authored-by: Alex Waygood --- Doc/library/syslog.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/syslog.rst b/Doc/library/syslog.rst index 488857d08ff8ed..7b27fc7e85b62d 100644 --- a/Doc/library/syslog.rst +++ b/Doc/library/syslog.rst @@ -146,7 +146,7 @@ The module defines the following constants: LOG_LOCAL6 LOG_LOCAL7 - Facilities, depending on availabiltiy in ```` for :const:`LOG_AUTHPRIV`, + Facilities, depending on availability in ```` for :const:`LOG_AUTHPRIV`, :const:`LOG_FTP`, :const:`LOG_NETINFO`, :const:`LOG_REMOTEAUTH`, :const:`LOG_INSTALL` and :const:`LOG_RAS`.