mirror of
https://github.com/JKorf/CryptoExchange.Net
synced 2025-06-08 16:36:15 +00:00
Replaced Debug.WriteLine with Trace.WriteLine
This commit is contained in:
parent
3cf5480cad
commit
3e23882572
@ -49,7 +49,7 @@ namespace CryptoExchange.Net.Converters
|
|||||||
|
|
||||||
if (!GetValue(stringValue, out var result))
|
if (!GetValue(stringValue, out var result))
|
||||||
{
|
{
|
||||||
Debug.WriteLine($"Cannot map enum. Type: {typeof(T)}, Value: {reader.Value}");
|
Trace.WriteLine($"{DateTime.Now:yyyy/MM/dd HH:mm:ss:fff} | Warning | Cannot map enum value. EnumType: {typeof(T)}, Value: {reader.Value}, Known values: {string.Join(", ", Mapping.Select(m => m.Value))}. If you think {reader.Value} should added please open an issue on the Github repo");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ namespace CryptoExchange.Net.Converters
|
|||||||
|| !int.TryParse(stringValue.Substring(4, 2), out var month)
|
|| !int.TryParse(stringValue.Substring(4, 2), out var month)
|
||||||
|| !int.TryParse(stringValue.Substring(6, 2), out var day))
|
|| !int.TryParse(stringValue.Substring(6, 2), out var day))
|
||||||
{
|
{
|
||||||
Debug.WriteLine("Unknown DateTime format: " + reader.Value);
|
Trace.WriteLine($"{DateTime.Now:yyyy/MM/dd HH:mm:ss:fff} | Warning | Unknown DateTime format: " + reader.Value);
|
||||||
return default;
|
return default;
|
||||||
}
|
}
|
||||||
return new DateTime(year, month, day, 0, 0, 0, DateTimeKind.Utc);
|
return new DateTime(year, month, day, 0, 0, 0, DateTimeKind.Utc);
|
||||||
@ -76,7 +76,7 @@ namespace CryptoExchange.Net.Converters
|
|||||||
|| !int.TryParse(stringValue.Substring(2, 2), out var month)
|
|| !int.TryParse(stringValue.Substring(2, 2), out var month)
|
||||||
|| !int.TryParse(stringValue.Substring(4, 2), out var day))
|
|| !int.TryParse(stringValue.Substring(4, 2), out var day))
|
||||||
{
|
{
|
||||||
Debug.WriteLine("Unknown DateTime format: " + reader.Value);
|
Trace.WriteLine("{DateTime.Now:yyyy/MM/dd HH:mm:ss:fff} | Warning | Unknown DateTime format: " + reader.Value);
|
||||||
return default;
|
return default;
|
||||||
}
|
}
|
||||||
return new DateTime(year + 2000, month, day, 0, 0, 0, DateTimeKind.Utc);
|
return new DateTime(year + 2000, month, day, 0, 0, 0, DateTimeKind.Utc);
|
||||||
@ -103,7 +103,7 @@ namespace CryptoExchange.Net.Converters
|
|||||||
|| !int.TryParse(values[1], out var month)
|
|| !int.TryParse(values[1], out var month)
|
||||||
|| !int.TryParse(values[2], out var day))
|
|| !int.TryParse(values[2], out var day))
|
||||||
{
|
{
|
||||||
Debug.WriteLine("Unknown DateTime format: " + reader.Value);
|
Trace.WriteLine("{DateTime.Now:yyyy/MM/dd HH:mm:ss:fff} | Warning | Unknown DateTime format: " + reader.Value);
|
||||||
return default;
|
return default;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ namespace CryptoExchange.Net.Converters
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug.WriteLine("Unknown DateTime format: " + reader.Value);
|
Trace.WriteLine("{DateTime.Now:yyyy/MM/dd HH:mm:ss:fff} | Warning | Unknown DateTime format: " + reader.Value);
|
||||||
return default;
|
return default;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ namespace CryptoExchange.Net.Converters
|
|||||||
|
|
||||||
if (!GetValue(objectType, mapping, stringValue, out var result))
|
if (!GetValue(objectType, mapping, stringValue, out var result))
|
||||||
{
|
{
|
||||||
Debug.WriteLine($"Cannot map enum. Type: {objectType.Name}, Value: {reader.Value}");
|
Trace.WriteLine($"{DateTime.Now:yyyy/MM/dd HH:mm:ss:fff} | Warning | Cannot map enum value. EnumType: {objectType.Name}, Value: {reader.Value}, Known values: {string.Join(", ", mapping.Select(m => m.Value))}. If you think {reader.Value} should added please open an issue on the Github repo");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -267,14 +267,14 @@ namespace CryptoExchange.Net
|
|||||||
{
|
{
|
||||||
var info = $"Deserialize JsonReaderException: {jre.Message}, Path: {jre.Path}, LineNumber: {jre.LineNumber}, LinePosition: {jre.LinePosition}. Data: {stringData}";
|
var info = $"Deserialize JsonReaderException: {jre.Message}, Path: {jre.Path}, LineNumber: {jre.LineNumber}, LinePosition: {jre.LinePosition}. Data: {stringData}";
|
||||||
log?.Write(LogLevel.Error, info);
|
log?.Write(LogLevel.Error, info);
|
||||||
if (log == null) Debug.WriteLine(info);
|
if (log == null) Trace.WriteLine($"{DateTime.Now:yyyy/MM/dd HH:mm:ss:fff} | Warning | {info}");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
catch (JsonSerializationException jse)
|
catch (JsonSerializationException jse)
|
||||||
{
|
{
|
||||||
var info = $"Deserialize JsonSerializationException: {jse.Message}. Data: {stringData}";
|
var info = $"Deserialize JsonSerializationException: {jse.Message}. Data: {stringData}";
|
||||||
log?.Write(LogLevel.Error, info);
|
log?.Write(LogLevel.Error, info);
|
||||||
if (log == null) Debug.WriteLine(info);
|
if (log == null) Trace.WriteLine($"{DateTime.Now:yyyy/MM/dd HH:mm:ss:fff} | Warning | {info}");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ namespace CryptoExchange.Net.Logging
|
|||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
// Can't write to the logging so where else to output..
|
// Can't write to the logging so where else to output..
|
||||||
Debug.WriteLine($"Failed to write log to writer {writer.GetType()}: " + e.ToLogString());
|
Trace.WriteLine($"{DateTime.Now:yyyy/MM/dd HH:mm:ss:fff} | Warning | Failed to write log to writer {writer.GetType()}: " + e.ToLogString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user