Skip to content

Swift Logger property is not concurrency-safe because it is nonisolated global shared mutable state #181683

Closed

Description

@jmagman

I tried turning on Swift 6 concurrency features for fun, and it found:

Logger.swift:42:22: warning: static property 'shared' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
  40 | /// ```
  41 | @objc(FlutterLogger) public final class Logger: NSObject {
  42 |   private static var shared = Logger()
     |                      |- warning: static property 'shared' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
     |                      |- note: convert 'shared' to a 'let' constant to make 'Sendable' shared state immutable
     |                      |- note: annotate 'shared' with '@MainActor' if property should only be accessed from the main actor
     |                      `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
  43 |   private let outputWriter: OutputWriter
  44 |   public let logLevel: LogLevel

https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8691364718599217841/+/u/build_ci_ios_debug_sim/stdout#L6663_1

#181654

Activity

  1. added
    platform-iosiOS applications specifically
    engineflutter/engine related. See also e: labels.
    platform-macosBuilding on or for macOS specifically
    team-infraOwned by Infrastructure team
    team-iosOwned by iOS platform team
    on Jan 29, 2026
  2. changed the title [-]Logger property is not concurrency-safe because it is nonisolated global shared mutable state[/-] [+]Swift Logger property is not concurrency-safe because it is nonisolated global shared mutable state[/+] on Jan 29, 2026
  3. flutter-triage-bot commented on Jan 29, 2026

    @flutter-triage-bot

    Issue is assigned to multiple teams (infra, ios). Please ensure the issue has only one team-* label at a time. Use fyi-* labels to have another team look at the issue without reassigning it.

  4. added
    P2Important issues not at the top of the work list
    triaged-iosTriaged by iOS platform team
    on Jan 29, 2026
  5. flutter-triage-bot commented on Jan 29, 2026

    @flutter-triage-bot

    The triaged-ios label is irrelevant if there is no team-ios label or fyi-ios label.

  6. self-assigned this
    on May 18, 2026
  7. flutter-triage-bot commented on Sep 21, 2026

    @flutter-triage-bot

    This issue is assigned to @cbracken but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!

  8. added
    ⏳Bot is counting down the days until it unassigns the issue
    on Sep 21, 2026
  9. cbracken commented on Sep 30, 2026

    @cbracken
    Member

    As luck would have it, I actually started on this one a while back (when I tried once more for os_log) but never finished! Thanks for the reminder.

  10. cbracken commented on Sep 30, 2026

    @cbracken
    Member

    Actually as luck would have it, I actually did land it in #181683

  11. github-actions commented on Oct 14, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  12. locked as resolved and limited conversation to collaborators on Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

⏳Bot is counting down the days until it unassigns the issueP2Important issues not at the top of the work listengineflutter/engine related. See also e: labels.platform-iosiOS applications specificallyplatform-macosBuilding on or for macOS specificallyteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions