I've read the definitive "Recording Private Data in the System Log" by @eskimo and the words at man 5 os_log
and written code to, specifically, turn on "Enable-Private-Data" in my app.
My application is a command line and I've configured Xcode to insert what I believe to be the appropriate incantations in an Info.plist
file into the unstructured executable binary. When I run the app with Terminal, I see <private>
output in the Console app where I expect values to be displayed in a public manner.
Nothing I've read says that <key>Enable-Private-Data</key><true/>
doesn't apply to command line apps, and my own understanding of the value of of the logging mechanism rejects that notion because logging is performed all over macOS, not just in a ***.app
environment.
A this point, I'm firmly convinced this unexpected behavior is of my own doing, but I have paused the search for my (probably embarrassing) mistake, to write this note because of a 1% doubt I'm wrong.
I'd be very happy to receive the, expected, assurance that logging configuration via an embedded Info.plist
in a command line app does influence logging behavior. With that assurance, I'll know it's my problem and I'll search/find/fix. On there way there, I'll create the simplest command line app that exhibits this anomaly -- which will likely reveal my error and, if not, it'll be fodder for a bug report.
Embedding an Info.plist
into a command line app is a tad out of the ordinary but I've done it before (using Xcode or SPM) to carry knowledge into a CLI via a mainBundle.infoDictionary
.. and in the particular case described above, I've printed that infoDictionary
to show the successful embedding, viz:
. . . .
"OSLogPreferences": {
"com.ramsaycons" = {
"DEFAULT-OPTIONS" = {
"Enable-Private-Data" = 1;
};
};
},
. . . .
Sonoma 14.5 / Xcode 15.4 / MBP (Apple M1 Max)