different "stack trace logging" on each debug channel ?

hi

the new “stack trace logging” level look great, but can it be apply differently to each Debug.Log* channel ?

for example, it is almost not useful to get C#/script stack for Debug.Log(); but a C#/script stack trace is wanted for Debug.LogError()…

thanks

Hey,

working is being done in that area, not sure if it will be available for 5.2, though. But if you’re really want such functionality now, you can implement it yourself by writing a custom logger.

something like this:

class Logger
{
    public void Log(string msg)
    {
       Application.stacktraceLogType = StackTraceLogType.None;
       Debug.Log(msg);
    }  
    public void LogError(string msg)
    {
       Application.stacktraceLogType = StackTraceLogType.Full;
       Debug.LogError(msg);
    }
}

we have a similar solution for 4.x, however, we lost the ability to double click on console and able to have VS/MD jump directly to the error line… which is not ideal

It’s a known issue, we have a bug regarding this,.

It would be cool if we could place an attribute above a method to skip that method when we double click on the log via the console.

The only way to do it right now is to compile your code in to a DLL. In the console, if you double click on any log’s made from inside a DLL you will be taken to the line in your project where you made the call to that DLL method.

I can see it being handy in a lot of cases. For example, if I write a Unity plugins that, say, loads the contents of some file, I could log an error in the Load method of my plugin if the file doesn’t exist. This Load method could have that attribute above it and when the user clicks on the error in the console (“File not found”), they would be taken to the line where they called the Load function.

shrug just a quick idea off the top of my head, might need some fleshing out.

Hey there,
Im sondering what the status on this is. I really love this feature, but without being able to specify it per channel its not that useful. In general fixing that custom logging functions work terriblly would be great. Thanks :slight_smile: