Skip to content

Commit 6c167e7

Browse files
committed
Tag Apple system log messages as public.
1 parent 0f1f7c7 commit 6c167e7

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
When system logging is enabled (with ``config.use_system_logger``, messages
2+
are now tagged as public. This allows the macOS 26 system logger to view
3+
messages without special configuration.

Python/pylifecycle.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3327,7 +3327,9 @@ apple_log_write_impl(PyObject *self, PyObject *args)
33273327

33283328
// Pass the user-provided text through explicit %s formatting
33293329
// to avoid % literals being interpreted as a formatting directive.
3330-
os_log_with_type(OS_LOG_DEFAULT, logtype, "%s", text);
3330+
// Using {public} ensures "dynamic" string messages are visible
3331+
// in the log without special configuration.
3332+
os_log_with_type(OS_LOG_DEFAULT, logtype, "%{public}s", text);
33313333
Py_RETURN_NONE;
33323334
}
33333335

0 commit comments

Comments
 (0)