Skip to content

Swift 6 - #29

Merged
David2XN merged 1 commit into
masterfrom
feature/swift6
Apr 23, 2026
Merged

David2XN merged 1 commit into
masterfrom
feature/swift6

Conversation

@David2XN

@David2XN David2XN commented Apr 22, 2026

Copy link
Copy Markdown
Contributor
  • Updated Package.swift to Swift tools version 6.0.
  • Changed Level.custom to store String instead of CustomStringConvertible.
  • Removed DateFormatter from LogHeader; formatting remains the responsibility of encoders.
  • Removed Combine
  • Removed unnecessary continuation wrapping from OSLogStore.getEntries.
  • Stopped using .init syntax for inits

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates the Logger package to Swift 6 language mode, removing Combine usage from the core library and adjusting logging model types to be Swift-concurrency friendly (e.g., Sendable, string-backed payloads).

Changes:

  • Bumps SwiftPM tools version to 6.0 and enables Swift 6 language mode.
  • Refactors logging models (LogEntry, LogHeader, Level, etc.) to remove DateFormatter from headers and store messages/custom levels as String, adding Sendable where appropriate.
  • Replaces Combine-based callback logging and updates async/queue usage patterns (incl. test updates and new thread-safe Counter test helper).

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Tests/LoggerTests/Loggers/NativeLogger+OSLogStoreTests.swift Updates test encoder to reflect LogEntry.message now being a String.
Tests/LoggerTests/Loggers/FileLoggerTests.swift Removes Combine usage, injects fileAccessQueue, updates LogHeader construction, and rewrites concurrency test logic.
Tests/LoggerTests/LoggerManagerTests.swift Removes Combine usage, updates expectation waiting, rewrites concurrency test logic.
Tests/LoggerTests/LogEntry+mock.swift Updates mock entry builder for new LogHeader initializer and LogLocation init usage.
Tests/LoggerTests/Counter.swift Adds a lock-protected counter utility for multithreaded tests.
Sources/Logger/Loggers/NativeLogger/OSLogStore/OSLogStore+getEntries.swift Simplifies async entry retrieval by removing unnecessary continuation wrapping.
Sources/Logger/Loggers/FileLogger/FileLogger.swift Simplifies file handle and UTF-8 conversion logic within the file-write path.
Sources/Logger/Loggers/FileLogger/FileAccessExecutor.swift Adjusts queue scheduling to use DispatchWorkItem (Swift 6 concurrency compatibility).
Sources/Logger/Loggers/ApplicationCallbackLogger.swift Removes Combine publisher, injects a logging callback closure, and updates macOS compile condition.
Sources/Logger/LoggerManager.swift Removes Combine subscriptions, wires application callbacks via injected closure, updates header init and queue dispatch call style.
Sources/Logger/LogEntry/LogLocation.swift Adds Sendable conformance.
Sources/Logger/LogEntry/LogHeader.swift Adds Sendable conformance and removes DateFormatter from the type/API.
Sources/Logger/LogEntry/LogEntryCoding/LogEntryEncoder.swift Minor initializer style update for Swift 6 mode.
Sources/Logger/LogEntry/LogEntryCoding/LogEntryDecoder.swift Updates decoding to use new LogHeader initializer and explicit type inits.
Sources/Logger/LogEntry/LogEntry.swift Adds Sendable, changes stored message to String while preserving convertible init input.
Sources/Logger/LogEntry/Level.swift Adds Sendable and changes .custom associated value to String.
Package.swift Updates tools version to Swift 6.0 and enables Swift 6 language mode.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Sources/Logger/Loggers/ApplicationCallbackLogger.swift Outdated
Comment thread Tests/LoggerTests/Loggers/FileLoggerTests.swift Outdated
@David2XN
David2XN merged commit 3315c1d into master Apr 23, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants