1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-08-20 12:53:02 +00:00

Order book logging

This commit is contained in:
JKorf
2024-03-22 17:02:21 +01:00
parent 8ddd9ecf22
commit af3303c7b8
3 changed files with 105 additions and 94 deletions
+2 -2
View File
@@ -49,11 +49,11 @@ namespace CryptoExchange.Net.Objects
public IDisposable? BeginScope<TState>(TState state) where TState : notnull => null!;
/// <inheritdoc />
public bool IsEnabled(LogLevel logLevel) => (int)logLevel < (int)_logLevel;
public bool IsEnabled(LogLevel logLevel) => (int)logLevel >= (int)_logLevel;
/// <inheritdoc />
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
{
if ((int)logLevel < (int)_logLevel)
if (!IsEnabled(logLevel))
return;
var logMessage = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss:fff} | {logLevel} | {(_categoryName == null ? "" : $"{_categoryName} | ")}{formatter(state, exception)}";