Skip to content

!! Use OSLogStore instead !! Tails and parses MacOS's /usr/bin/log for log notifications

License

Notifications You must be signed in to change notification settings

BrianHenryIE/BHSwiftOSLogStream

Repository files navigation

Swift OS Log Stream

⚠️ Use OSLogStore instead.

Opens a /usr/bin/log stream Process and parses data sent to the Pipe via its readabilityHandler with Regex.

Use

Instantiate a LogStream's:

init(subsystem: String, delegate: LogStreamDelegateProtocol, historySize: Int? = nil)

where subsystem is e.g. "com.apple.TimeMachine", LogStreamDelegateProtocol is:

func newLogEntry(entry: LogEntry, history: History<LogEntry>)

and History is a FIFO queue of the specified length, or nil for infinite length.

The previous logs are returned since the event indicated by the current log entry might desire data from other recent entries. E.g. when a Time Machine backup completes, that event does not contain the volume name, but it will be in a recent log entry.

Requires Admin Access

I believe any apps built with this will require admin access to read /usr/bin/log.

New XCode apps include the App Sandbox capability which must be removed – under the target's "signing and capabilities".

Possible Improvements

Further Reading

About

!! Use OSLogStore instead !! Tails and parses MacOS's /usr/bin/log for log notifications

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages