Removed DiscordRpcClient's second log header
This commit is contained in:
@@ -27,7 +27,6 @@ namespace Discord
|
|||||||
private TaskCompletionSource<bool> _connectTask;
|
private TaskCompletionSource<bool> _connectTask;
|
||||||
private CancellationTokenSource _cancelToken, _reconnectCancelToken;
|
private CancellationTokenSource _cancelToken, _reconnectCancelToken;
|
||||||
private Task _reconnectTask;
|
private Task _reconnectTask;
|
||||||
private bool _isFirstLogSub;
|
|
||||||
private bool _isReconnecting;
|
private bool _isReconnecting;
|
||||||
private bool _canReconnect;
|
private bool _canReconnect;
|
||||||
|
|
||||||
@@ -42,7 +41,6 @@ namespace Discord
|
|||||||
: base(config, CreateApiClient(config))
|
: base(config, CreateApiClient(config))
|
||||||
{
|
{
|
||||||
_rpcLogger = LogManager.CreateLogger("RPC");
|
_rpcLogger = LogManager.CreateLogger("RPC");
|
||||||
_isFirstLogSub = true;
|
|
||||||
|
|
||||||
_serializer = new JsonSerializer { ContractResolver = new DiscordContractResolver() };
|
_serializer = new JsonSerializer { ContractResolver = new DiscordContractResolver() };
|
||||||
_serializer.Error += (s, e) =>
|
_serializer.Error += (s, e) =>
|
||||||
@@ -98,12 +96,6 @@ namespace Discord
|
|||||||
if (!isReconnecting && _reconnectCancelToken != null && !_reconnectCancelToken.IsCancellationRequested)
|
if (!isReconnecting && _reconnectCancelToken != null && !_reconnectCancelToken.IsCancellationRequested)
|
||||||
_reconnectCancelToken.Cancel();
|
_reconnectCancelToken.Cancel();
|
||||||
|
|
||||||
if (_isFirstLogSub)
|
|
||||||
{
|
|
||||||
_isFirstLogSub = false;
|
|
||||||
await WriteInitialLog().ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
var state = ConnectionState;
|
var state = ConnectionState;
|
||||||
if (state == ConnectionState.Connecting || state == ConnectionState.Connected)
|
if (state == ConnectionState.Connecting || state == ConnectionState.Connected)
|
||||||
await DisconnectInternalAsync(null, isReconnecting).ConfigureAwait(false);
|
await DisconnectInternalAsync(null, isReconnecting).ConfigureAwait(false);
|
||||||
@@ -286,22 +278,5 @@ namespace Discord
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task WriteInitialLog()
|
|
||||||
{
|
|
||||||
await _clientLogger.InfoAsync($"DiscordRpcClient v{DiscordRestConfig.Version} (RPC v{DiscordRpcConfig.RpcAPIVersion})").ConfigureAwait(false);
|
|
||||||
await _clientLogger.VerboseAsync($"Runtime: {RuntimeInformation.FrameworkDescription.Trim()} ({ToArchString(RuntimeInformation.ProcessArchitecture)})").ConfigureAwait(false);
|
|
||||||
await _clientLogger.VerboseAsync($"OS: {RuntimeInformation.OSDescription.Trim()} ({ToArchString(RuntimeInformation.OSArchitecture)})").ConfigureAwait(false);
|
|
||||||
await _clientLogger.VerboseAsync($"Processors: {Environment.ProcessorCount}").ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
private static string ToArchString(Architecture arch)
|
|
||||||
{
|
|
||||||
switch (arch)
|
|
||||||
{
|
|
||||||
case Architecture.X64: return "x64";
|
|
||||||
case Architecture.X86: return "x86";
|
|
||||||
default: return arch.ToString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user