LoggerPro — Runtime/Common¶
Four small pieces the logging path needs, none of which belong to any one part of it.
LoggerProEchoGuard.cs — marks the window during which LoggerPro is writing its own echo to the Unity console, so the capture can ignore it. Without this the capture re-ingests the echo of every entry and logs it again, forever.
Thread-static, because the echo happens synchronously on whichever thread logged and Unity's threaded log callback fires on that same thread. The scope is a readonly struct that restores the previous value rather than clearing it — this is entered on every single log, so the common path must not allocate, and nested scopes have to behave.
LoggerProMainThread.cs — which thread Unity's APIs may be called from, and a guarantee that LoggerPro is warm before any of the user's code runs.
Two things stay main-thread only however carefully the rest is locked: ScriptableObject.CreateInstance, which builds the configuration on first touch, and EditorPrefs, which supplies the per-category cap. The first is handled by making sure the first touch has already happened here, before the first scene; the second by reading the preference only on the main thread and reusing the last value everywhere else.
Without the warm-up, a game whose first log came from a loading thread latched the store as loaded with a null config, and every later log call on every thread threw inside the caller's own code for the rest of the session.
LoggerProStackTrace.cs — trims LoggerPro's own frames off a captured call stack. Every log passes through the formatter, the service, the facade and possibly the Lite bridge, so a raw trace opens with ten frames of plumbing before the line the developer actually wrote.
LoggerProWarnings.cs — warn-once for unknown categories. The set is locked: "once" has to mean once across threads too, and two workers logging to the same unknown category both got past a plain Contains check and then both wrote to a HashSet, which corrupts rather than duplicates.