Revision Difference
Debugging#524921
<cat>code.general</cat>⤶
<title>Debugging</title>⤶
⤶
# Debugging Callbacks⤶
⤶
You can get a list of callbacks being called by implementing OnDebugCallback, something like this:⤶
⤶
```⤶
Steamworks.Dispatch.OnDebugCallback = ( type, str, server ) =>⤶
{⤶
Console.WriteLine( $"[Callback {type} {(server ? "server" : "client")}]" );⤶
Console.WriteLine( str );⤶
Console.WriteLine( $"" );⤶
};⤶
```⤶
⤶
# Callback Exceptions⤶
⤶
Because callbacks happen in an Async Task you might not always be able to catch the exceptions.⤶
⤶
To get the exceptions you can hook this function.⤶
⤶
```⤶
Steamworks.Dispatch.OnException = ( e ) =>⤶
{⤶
Console.Error.WriteLine( e.Message );⤶
Console.Error.WriteLine( e.StackTrace );⤶
};⤶
```⤶