mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-31 00:50:45 +01:00
Better CommsContext logging
This commit is contained in:
@@ -88,12 +88,13 @@ namespace Tgstation.Server.Host.Components.Interop
|
||||
/// <param name="e">The <see cref="FileSystemEventArgs"/></param>
|
||||
async void HandleWrite(object sender, FileSystemEventArgs e) //this is what async void was made for
|
||||
{
|
||||
logger.LogTrace("FileSystemWatcher triggered...");
|
||||
try
|
||||
{
|
||||
var fileBytes = await ioManager.ReadAllBytes(e.FullPath, cancellationToken).ConfigureAwait(false);
|
||||
var file = Encoding.UTF8.GetString(fileBytes);
|
||||
|
||||
logger.LogTrace("Read interop command json: {0}", file);
|
||||
|
||||
CommCommand command;
|
||||
try
|
||||
{
|
||||
@@ -105,7 +106,7 @@ namespace Tgstation.Server.Host.Components.Interop
|
||||
catch (JsonSerializationException ex)
|
||||
{
|
||||
//file not fully written yet
|
||||
logger.LogTrace("Suppressing json convert exception: {0}", ex);
|
||||
logger.LogDebug("Suppressing json convert exception for command file write: {0}", ex);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -113,7 +114,7 @@ namespace Tgstation.Server.Host.Components.Interop
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.LogDebug("Exception while trying to read command json: {0}", ex);
|
||||
logger.LogDebug("Exception while trying to handle command json write: {0}", ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user