Skip to content

Make StreamLogHandler initializers public - #477

Merged
kukushechkin merged 7 commits into
apple:mainfrom
subhramit:public-streamloghandlers
Jun 25, 2026
Merged

Make StreamLogHandler initializers public#477
kukushechkin merged 7 commits into
apple:mainfrom
subhramit:public-streamloghandlers

Conversation

@subhramit

@subhramit subhramit commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Make StreamLogHandler initializers public.

Motivation:

Closes #273

Modifications:

Promote the two stream-accepting initializers from internal to public. Also as a result, their stream parameter is spelled out as any TextOutputStream & Sendable rather than the internal _SendableTextOutputStream typealias, which cannot appear in a public signature. The private stored property and the internal typealias are otherwise unchanged. The internal typealias has been completely removed as it was only used to store the stream, and the private stored property is updated to use the spelled-out type.

Also updates the docc documentation accordingly.

Result:

Users would be able to construct a StreamLogHandler with their own TextOutputStream implementation, reusing the existing logic to format log messages and prettify metadata instead of reimplementing them.

@kukushechkin kukushechkin added the 🆕 semver/minor Adds new public API. label Jun 24, 2026
@subhramit

Copy link
Copy Markdown
Contributor Author

The failing CI checks seem to be a toolchain/package-config mismatch and unrelated to my changes.

Comment thread Sources/Logging/Handlers/StreamLogHandler.swift
Signed-off-by: subhramit <subhramit.bb@live.in>
Signed-off-by: subhramit <subhramit.bb@live.in>
Signed-off-by: subhramit <subhramit.bb@live.in>
@subhramit
subhramit requested a review from kukushechkin June 24, 2026 16:39
Comment thread Sources/Logging/Handlers/StreamLogHandler.swift
Signed-off-by: subhramit <subhramit.bb@live.in>
@subhramit
subhramit requested a review from kukushechkin June 25, 2026 14:49

@kukushechkin kukushechkin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@subhramit Thank you!

@kukushechkin
kukushechkin merged commit 1895d78 into apple:main Jun 25, 2026
151 of 160 checks passed
@subhramit
subhramit deleted the public-streamloghandlers branch June 25, 2026 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🆕 semver/minor Adds new public API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make StreamLogHandler initializers public

2 participants