Search Unity

SetStackTraceLogType from other thread

Discussion in 'Scripting' started by kraihd, Sep 30, 2019.

  1. kraihd

    kraihd

    Joined:
    Sep 10, 2015
    Posts:
    20
    Is there any trick to SetStackTraceLogType from non-main thread?

    I am trying to write a parallel process.
    The main thread is to print only important or exception logs, and the other thread is to print a lot of short logs.
    Logs of the former should be with stacktrace, and that of the latter without.

    It is a big problem here that Application.SetStackTraceLogType cannot be called from sub thread.
    I tried creating a class dispatching logs and printing at last of frame, but found that it was dangerous because it easily cause deadlock.
    I felt it was overscaled. Unity already must be doing same thing internally. All it is required is just that some logs print stacktrace and others does not.
    I suspect that there should be a simple solution.
     
    Last edited: Sep 30, 2019