Repository navigation
fix(log): readable auto-hide and hide-failure lines in Console - #554
Merged
Merged
Conversation
Foundation's NSLog marks every value <private> on recent macOS, so Console
and log show only printed <private>. A module-level NSLog now logs the
message with os_log %{public}@ under the app's bundle id and writes the same
line to stderr, as before. The Objective-C shim does the same by hand.
The macOS 27 unavailable line logged the full app path; it now logs it with the home folder as ~, since the log is public.
…tderr" This reverts commit 3d9c509.
NSLog stays private in the unified log. AppLog.publicLine takes a StaticString, so no run-time data can reach the public log, and also writes the line to stderr. The five auto-collapse hold reasons, the popup guard hold and cap, the hiding unavailable reasons and the collapse timeout use it; lines that carry data keep their private line beside it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On macOS 27 every
NSLogline from Hidden Bar shows as<private>in the unified log, so Console andlog showare empty for a user who wants to report a stuck bar. This makes a small, fixed set of lines readable there and documents how to capture the rest.What changes
AppLog.publicLine(_:)takes aStaticString, so the compiler rejects any text built at run time. It writes to the unified log as public and to stderr once.NSLogline next to it.~, because captured logs get attached to issues.docs/MANUAL.mdgains "Capture a log":open --stderr ~/Desktop/hiddenbar.log "/Applications/Hidden Bar.app".Why not make every line public
The first version of this branch did that (commit
3d9c509, reverted by79ab40f). It would have put the list of the user's menu bar apps into Console and sysdiagnoses. Private stays the default.Tests
Run in the mac-ui VM,
Hidden Barscheme,Debug-Direct:AppLogTests,AutoCollapsePopupGuardTests,AutoStartTests: 32 passed.MenuBarEngineTests,RevealControllerTests: 24 passed.Constant.swift: theNSLogline shows<private>, thepublicLineline shows its text.Not yet checked: the real app's lines in Console on macOS 27. A VM run of the develop build follows.