Releases: apple/swift-log
1.6.4
What's Changed
SemVer Patch
Other Changes
- Enable macOS CI on merge to main and daily timer by @rnro in #357
- Enable macOS CI on pull requests by @rnro in #358
- Add static SDK CI workflow by @rnro in #355
- Enable Swift 6.1 jobs in CI by @rnro in #359
- Remove inaccurate code comment by @gwynne in #349
- Overhaul
README
and documentation catalog to introduce best practices by @FranzBusch in #363 - Add an article how to implement a log handler by @FranzBusch in #364
- Fix broken link to documentation on README by @simonjbeaumont in #365
New Contributors
- @marcprux made their first contribution in #356
- @simonjbeaumont made their first contribution in #365
Full Changelog: 1.6.3...1.6.4
1.6.3
What's Changed
SemVer Patch
- Enable strict concurrency by @czechboy0 in #342
- Fix building on Fedora 39 and Ubuntu 24.04 by @czechboy0 in #354
Other Changes
- Aligning semantic version label check name by @FranzBusch in #341
- Add AndroidLogging to the list of available backends by @lhoward in #340
- Enable MemberImportVisibility check on all targets by @rnro in #343
- Update release.yml by @FranzBusch in #344
- Add swift-log-systemd.git to the list of available backends (#345) by @lhoward in #345
- fix: fix typo by @SunsetWan in #333
- Add swift-log-systemd has moved (#345) by @lhoward in #346
- CI use 6.1 nightlies by @rnro in #348
- Rename nightly_6_1 params to nightly_next by @rnro in #352
- Only apply standard swift settings on valid targets by @rnro in #353
New Contributors
- @lhoward made their first contribution in #340
- @czechboy0 made their first contribution in #342
- @SunsetWan made their first contribution in #333
Full Changelog: 1.6.2...1.6.3
1.6.2
What's Changed
SemVer Patch
- Fix Windows warnings by @FranzBusch in #331
Other Changes
- [CI] Migrate to GHA by @FranzBusch in #328
- Enhance swift code-block at README.md by @lamtrinhdev in #327
- add .editorconfig file by @rnro in #338
- Add Scout to the list of available backends by @kasianov-mikhail in #337
New Contributors
- @lamtrinhdev made their first contribution in #318
- @hyp made their first contribution in #325
- @rnro made their first contribution in #338
- @kasianov-mikhail made their first contribution in #337
Full Changelog: 1.6.1...1.6.2
Swift Log 1.6.1
SemVer Patch
- Disable existential any build setting (#312)
1.6.0
SemVer Minor
- Add Sendability annotations in #308
- Fix deprecation warnings around default log implementations on handlers in #310
- Drop Swift versions earlier than 5.8 in #299
- Implement Copy-On-Write (CoW) behavior for Logger struct by @ayushi2103 in #297
SemVer Patch
- Replace standardOutput to standardError by @ayushi2103 in #295
- Use Set to spot duplicated log handler warnings in #306
- Make protocol usage obvious using any and some keywords in #307
- Remove documentation for non-existent arguments by @b1ackturtle in #309
- Remove Docc plugin which is no longer required in #311
Other Changes
1.5.4
What's Changed
Cleanups & minor compatibility improvements
- Don't assume localtime() result is non-nil by @gwynne in #280
- Changes to build with Musl. by @al45tair in #283
Non code changes
- Add CocoaLumberjack to list of logging backends by @ffried in #276
- update CI script by @tomerd in #281
- Update README.md by @0xTim in #279
New Contributors
- @ffried made their first contribution in #276
- @0xTim made their first contribution in #279
- @al45tair made their first contribution in #283
Full Changelog: 1.5.3...1.5.4
1.5.3
What's Changed
Cleanups & minor compatibility improvements
- Remove leftover 5.0 Package.swift; not supported since 1.5.0 by @ktoso in #259
- Use #if canImport(Darwin) where possible by @FranzBusch in #269
- docs: fix typos by @FannyGautierr in #272
Non code changes
- Add DiscordBM/DiscordLogger to loggers list by @MahdiBM in #257
- Update CI by @yim-lee in #264
- update code of conduct by @tomerd in #268
- Fix DiscordLogger link by @MahdiBM in #266
- add kiliankoe/swift-log-matrix to list of backends by @kiliankoe in #263
New Contributors
- @MahdiBM made their first contribution in #257
- @kiliankoe made their first contribution in #263
- @FannyGautierr made their first contribution in #272
Full Changelog: 1.5.2...1.5.3
1.5.2
Primary change
Address too aggressive warning logging on LogHandlers that do not support MetadataProvider
. The warning would be emitted too frequently, resulting in flooding logs with warnings. Instead, the warning is now emitted once per log handler type.
What's Changed
- Avoid logging warnings when handler does not support metadataproviders by @ktoso in #252
- Handle providers properly in multiplex log handler by @ktoso in #254
- Add CI for Swift 5.8 and update nightly to Ubuntu 22.04 by @yim-lee in #255
Full Changelog: 1.5.1...1.5.2
1.5.1
Summary
This patch release focuses on minor cleanups to ergonomics of setting metadata providers with the default stream log handlers, and fixes a bug in the default handler not printing the provided extra metadata by default (it does now).
Thank you to @slashmo for quickly noticing and providing a patch for the latter!
What's Changed
- Allow passing explicit provider into the stream handlers by @ktoso in #250
- Emit correct metadata from StreamLogHandler by @slashmo in #251
Full Changelog: 1.5.0...1.5.1
1.5.0
Changes
Swift version support
This release drops support for Swift 5.0.
Swift 5.1+ remain supported for the time being.
Logger.MetadataProvider
This release introduces metadata providers!
They are an additional way to add metadata to your log statements automatically whenever a log statement is about to be made. This works extremely well with systems like distributed tracing, that may pick up trace identifiers and other information from the task-local context from where the log statement is being made.
The feature came with a swift evolution style proposal introduction to the "why?" and "how?" of this feature you may find interesting.
Metadata providers are used like this:
import Logging
enum Namespace {
@TaskLocal static var simpleTraceID: String?
}
let simpleTraceIDMetadataProvider = Logger.MetadataProvider {
guard let traceID = Namespace.simpleTraceID else {
return [:]
}
return ["simple-trace-id": .string(traceID)]
}
LoggingSystem.bootstrap({ label, metadataProvider in
myCoolLogHandler(label: label, metadataProvider: metadataProvider)
}, metadataProvider: simpleTraceIDMetadataProvider)
which in turn makes every Logger
on this LoggingSystem
add this contextual metadata to log statements automatically:
let log = Logger(label: "hello")
Namespace.$simpleTraceID.withValue("1234-5678") {
test()
}
func test() {
log.info("test log statement")
}
// [info] [simple-trace-id: 1234-5678] test log statement
Adoption in LogHandler
s
In order to support this new feature in your log handlers, please make it accept a MetadataProvider?
at creation, and store it as:
struct MyHandler: LogHandler {
// ...
public var metadataProvider: Logger.MetadataProvider?
// ...
}
What's Changed
Highlight
Other changes
- [docs] Minimal docc setup and landing page by @ktoso in #226
- =docc Make docs use symbol references by @ktoso in #230
- =docc Move to multiple Package.swift files by @ktoso in #231
- Undo 5.7 package files, not needed yet by @ktoso in #232
- Update README: Add missing Source param by @rusik in #233
- Fix build for wasm by @ahti in #236
- Add .spi.yml for Swift Package Index DocC support by @yim-lee in #240
- Fixes link to Supabase repository in README.md by @timobollwerk in #245
New Contributors
- @rusik made their first contribution in #233
- @ahti made their first contribution in #236
- @timobollwerk made their first contribution in #245
Full Changelog: 1.4.4...1.5.0