1
0
mirror of https://github.com/JKorf/CryptoExchange.Net synced 2025-06-09 17:06:19 +00:00

Some options logging

This commit is contained in:
Jkorf 2022-01-07 16:23:42 +01:00
parent fb9e9f9aa6
commit 996f3c2ced
3 changed files with 11 additions and 4 deletions

View File

@ -35,6 +35,11 @@ namespace CryptoExchange.Net
/// </summary>
internal protected string BaseAddress { get; }
/// <summary>
/// Api client options
/// </summary>
internal ApiClientOptions Options { get; }
/// <summary>
/// ctor
/// </summary>
@ -42,6 +47,7 @@ namespace CryptoExchange.Net
/// <param name="apiOptions">Api client options</param>
protected BaseApiClient(BaseClientOptions options, ApiClientOptions apiOptions)
{
Options = apiOptions.;
_apiCredentials = apiOptions.ApiCredentials?.Copy() ?? options.ApiCredentials?.Copy();
BaseAddress = apiOptions.BaseAddress;
}

View File

@ -68,7 +68,7 @@ namespace CryptoExchange.Net
ExchangeName = exchangeName;
log.Write(LogLevel.Debug, $"Client configuration: {options}, CryptoExchange.Net: v{typeof(BaseClient).Assembly.GetName().Version}, {ExchangeName}.Net: v{GetType().Assembly.GetName().Version}");
log.Write(LogLevel.Trace, $"Client configuration: {options}, CryptoExchange.Net: v{typeof(BaseClient).Assembly.GetName().Version}, {ExchangeName}.Net: v{GetType().Assembly.GetName().Version}");
}
/// <summary>
@ -77,6 +77,7 @@ namespace CryptoExchange.Net
/// <param name="apiClient">The client</param>
protected T AddApiClient<T>(T apiClient) where T: BaseApiClient
{
log.Write(LogLevel.Trace, $" {apiClient.GetType().Name} configuration: {apiClient.Options}");
ApiClients.Add(apiClient);
return apiClient;
}

View File

@ -81,7 +81,7 @@ namespace CryptoExchange.Net.Objects
/// <inheritdoc />
public override string ToString()
{
return $"{base.ToString()}, Proxy: {(Proxy == null ? "-" : Proxy.Host)}";
return $"{base.ToString()}, Proxy: {(Proxy == null ? "-" : Proxy.Host)}, Base.ApiCredentials: {(ApiCredentials == null ? "-" : "set")}";
}
}
@ -178,7 +178,7 @@ namespace CryptoExchange.Net.Objects
public new void Copy<T>(T input, T def) where T : BaseSocketClientOptions
{
base.Copy(input, def);
input.AutoReconnect = def.AutoReconnect;
input.ReconnectInterval = def.ReconnectInterval;
input.MaxReconnectTries = def.MaxReconnectTries;
@ -256,7 +256,7 @@ namespace CryptoExchange.Net.Objects
/// <inheritdoc />
public override string ToString()
{
return $"{base.ToString()}, Credentials: {(ApiCredentials == null ? "-" : "Set")}, BaseAddress: {BaseAddress}";
return $"Credentials: {(ApiCredentials == null ? "-" : "Set")}, BaseAddress: {BaseAddress}";
}
}