Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All notable changes to AXorcist will be documented in this file.

## [Unreleased]

### Fixed
- Keep the public swift-log convenience overloads nonisolated so importing AXorcist does not impose main-actor isolation on downstream log calls.

## [0.1.3] - 2026-07-14

### Fixed
Expand Down
1 change: 1 addition & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ let package = Package(
name: "AXorcistTests",
dependencies: [
"AXorcist", // Dependency restored to AXorcist
.product(name: "Logging", package: "swift-log"),
],
path: "Tests/AXorcistTests", // Explicit path
swiftSettings: approachableConcurrencySettings
Expand Down
8 changes: 4 additions & 4 deletions Sources/AXorcist/Logging/GlobalAXLogger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -171,22 +171,22 @@ public class GlobalAXLogger {

extension Logging.Logger {
@inlinable
public func debug(_ message: @autoclosure () -> String) {
public nonisolated func debug(_ message: @autoclosure () -> String) {
self.log(level: .debug, "\(message())")
}

@inlinable
public func info(_ message: @autoclosure () -> String) {
public nonisolated func info(_ message: @autoclosure () -> String) {
self.log(level: .info, "\(message())")
}

@inlinable
public func warning(_ message: @autoclosure () -> String) {
public nonisolated func warning(_ message: @autoclosure () -> String) {
self.log(level: .warning, "\(message())")
}

@inlinable
public func error(_ message: @autoclosure () -> String) {
public nonisolated func error(_ message: @autoclosure () -> String) {
self.log(level: .error, "\(message())")
}
}
Expand Down
19 changes: 19 additions & 0 deletions Tests/AXorcistTests/LoggerIsolationTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import Logging
import Testing
@testable import AXorcist

@Suite("Logger isolation")
struct LoggerIsolationTests {
@Test("convenience overloads are callable outside the main actor")
func convenienceOverloadsAreNonisolated() {
let logger = Logger(label: "AXorcistTests.LoggerIsolation")
Self.logAllLevels(logger)
}

nonisolated private static func logAllLevels(_ logger: Logger) {
logger.debug("debug")
logger.info("info")
logger.warning("warning")
logger.error("error")
}
}
Loading