Refactor some logging.
This commit is contained in:
@@ -159,7 +159,6 @@ namespace MarketData.Helper
|
||||
return false;
|
||||
}
|
||||
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Got {0} dividend history records for {1}", dividendHistory.Count, symbol));
|
||||
MDTrace.WriteLine(LogLevel.DEBUG,"Adding...");
|
||||
if (DividendHistoryDA.InsertOrUpdate(dividendHistory)) MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Added {0} dividend history records for {1}", dividendHistory.Count, symbol));
|
||||
else MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Failed to update dividend history for {0}", symbol));
|
||||
return true;
|
||||
|
||||
@@ -150,6 +150,9 @@ namespace MarketData.Helper
|
||||
}
|
||||
|
||||
private static void LoadInsiderTransactionsSymbolEx(String symbol)
|
||||
{
|
||||
Profiler profiler = new Profiler();
|
||||
try
|
||||
{
|
||||
symbol = symbol.ToUpper();
|
||||
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Load insider transactions for {0}", symbol));
|
||||
@@ -161,7 +164,11 @@ namespace MarketData.Helper
|
||||
}
|
||||
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Insider Transactions, Saving {0} records for {1}", insiderTransactions.Count, symbol));
|
||||
InsiderTransactionDA.InsertInsiderTransactions(insiderTransactions);
|
||||
MDTrace.WriteLine(LogLevel.DEBUG,"Insider Transactions - Done.");
|
||||
}
|
||||
finally
|
||||
{
|
||||
MDTrace.WriteLine(LogLevel.DEBUG,$"{symbol} Done, took {profiler.End()}(ms)");
|
||||
}
|
||||
}
|
||||
|
||||
private void ThreadPoolCallbackYearGreaterEqual(Object threadHelperContext)
|
||||
@@ -175,6 +182,9 @@ namespace MarketData.Helper
|
||||
}
|
||||
|
||||
private static void LoadInsiderTransactionsYearGreaterEqualEx(String symbol, int yearGreaterEqual)
|
||||
{
|
||||
Profiler profiler = new Profiler();
|
||||
try
|
||||
{
|
||||
symbol = symbol.ToUpper();
|
||||
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Load insider transactions for {0} years>={1}", symbol,yearGreaterEqual));
|
||||
@@ -187,7 +197,11 @@ namespace MarketData.Helper
|
||||
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Insider Transactions, Saving {0} records for {1} years>={2}", insiderTransactions.Count, symbol, yearGreaterEqual));
|
||||
InsiderTransactionDA.DeleteInsiderTransactionsYearsGreaterEqual(symbol, yearGreaterEqual);
|
||||
InsiderTransactionDA.InsertInsiderTransactions(insiderTransactions);
|
||||
MDTrace.WriteLine(LogLevel.DEBUG,"Insider Transactions - Done.");
|
||||
}
|
||||
finally
|
||||
{
|
||||
MDTrace.WriteLine(LogLevel.DEBUG,$"{symbol} Done, took {profiler.End()}(ms)");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user