Cysharp / ZLogger

Zero Allocation Text/Structured Logger for .NET with StringInterpolation and Source Generator, built on top of a Microsoft.Extensions.Logging.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IL2CPP build problem with UnityLoggerFactory

ParsaRt opened this issue · comments

Hi, UnityLoggerFactory throws this exception on IL2CPP build (tried both .net standard and framework), any ideas what might be the cause of this ?

ArgumentNullException: Value cannot be null.
Parameter name: obj
System.Threading.Monitor.ReliableEnterTimeout (System.Object obj, System.Int32 timeout, System.Boolean& lockTaken) (at <00000000000000000000000000000000>:0)
Microsoft.Extensions.DependencyInjection.DependencyInjectionEventSource.ServiceProviderBuilt (Microsoft.Extensions.DependencyInjection.ServiceProvider provider) (at <00000000000000000000000000000000>:0)
Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider (Microsoft.Extensions.DependencyInjection.IServiceCollection services, Microsoft.Extensions.DependencyInjection.ServiceProviderOptions options) (at <00000000000000000000000000000000>:0)
ZLogger.UnityLoggerFactory.Create (System.Action`1[T] configure) (at <00000000000000000000000000000000>:0)
IntroSceneManager.InitLogger () (at <00000000000000000000000000000000>:0)
IntroSceneManager.Start () (at <00000000000000000000000000000000>:0)
System.Runtime.CompilerServices.AsyncVoidMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) (at <00000000000000000000000000000000>:0)
IntroSceneManager.Start () (at <00000000000000000000000000000000>:0)

@ParsaRt Thanks for the report.
But, I could not reproduce it.

From the log, it may be due to IL2CPP code stripping.

  • Have you changed the version of the dll in Microsoft.Extensions.*?
    • In that case, additional code stripping measures may be necessary
  • Can you tell me the version of Unity and the version of ZLogger?
    • Maybe I can reproduce it too, depending on the version.