Skip to content

Sync logs - #27

Merged
Finemas merged 1 commit into
developfrom
sync-logs
Mar 16, 2026
Merged

Finemas merged 1 commit into
developfrom
sync-logs

Conversation

@David2XN

Copy link
Copy Markdown
Contributor

This changes logging execution from a global behavior in LoggerManager to a per-logger behavior.

LoggerManager now sends synchronous loggers immediately on the caller thread and dispatches only asynchronous loggers onto its serial background queue. FileLogger is configured as asynchronous, while the rest
of the built-in loggers remain synchronous by default. This makes console/native logs visible immediately during debugging or before crashes, without forcing file writes onto the caller thread.

What changed

  • Added isAsynchronous: Bool to Logging, defaulting to false
  • Updated LoggerManager to split log delivery into sync and async paths
  • Kept FileLogger asynchronous
  • Left other built-in loggers synchronous by default
  • Fixed the Swift 6 retroactive conformance warning by marking OSLogEntry’s Identifiable conformance as @retroactive

Why

Previously, all loggers were funneled through the same async queue, which delayed console output. That made debugging worse because logs could be missing when hitting breakpoints or when the app crashed. With
this change, console-oriented loggers can remain synchronous, while heavier loggers like FileLogger can still run asynchronously.

@David2XN
David2XN changed the base branch from master to develop March 15, 2026 17:02
@Finemas
Finemas self-requested a review March 16, 2026 15:20
@Finemas Finemas self-assigned this Mar 16, 2026
@Finemas
Finemas merged commit ac967d3 into develop Mar 16, 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.

2 participants