Refactor some logging.
This commit is contained in:
@@ -159,7 +159,6 @@ namespace MarketData.Helper
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Got {0} dividend history records for {1}", dividendHistory.Count, symbol));
|
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));
|
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));
|
else MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Failed to update dividend history for {0}", symbol));
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -151,17 +151,24 @@ namespace MarketData.Helper
|
|||||||
|
|
||||||
private static void LoadInsiderTransactionsSymbolEx(String symbol)
|
private static void LoadInsiderTransactionsSymbolEx(String symbol)
|
||||||
{
|
{
|
||||||
symbol = symbol.ToUpper();
|
Profiler profiler = new Profiler();
|
||||||
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Load insider transactions for {0}", symbol));
|
try
|
||||||
InsiderTransactions insiderTransactions = MarketDataHelper.GetInsiderTransactions(symbol);
|
|
||||||
if (null == insiderTransactions || 0 == insiderTransactions.Count)
|
|
||||||
{
|
{
|
||||||
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("No insider transactions for {0}", symbol));
|
symbol = symbol.ToUpper();
|
||||||
return;
|
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Load insider transactions for {0}", symbol));
|
||||||
|
InsiderTransactions insiderTransactions = MarketDataHelper.GetInsiderTransactions(symbol);
|
||||||
|
if (null == insiderTransactions || 0 == insiderTransactions.Count)
|
||||||
|
{
|
||||||
|
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("No insider transactions for {0}", symbol));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Insider Transactions, Saving {0} records for {1}", insiderTransactions.Count, symbol));
|
||||||
|
InsiderTransactionDA.InsertInsiderTransactions(insiderTransactions);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
MDTrace.WriteLine(LogLevel.DEBUG,$"{symbol} Done, took {profiler.End()}(ms)");
|
||||||
}
|
}
|
||||||
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.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ThreadPoolCallbackYearGreaterEqual(Object threadHelperContext)
|
private void ThreadPoolCallbackYearGreaterEqual(Object threadHelperContext)
|
||||||
@@ -176,18 +183,25 @@ namespace MarketData.Helper
|
|||||||
|
|
||||||
private static void LoadInsiderTransactionsYearGreaterEqualEx(String symbol, int yearGreaterEqual)
|
private static void LoadInsiderTransactionsYearGreaterEqualEx(String symbol, int yearGreaterEqual)
|
||||||
{
|
{
|
||||||
symbol = symbol.ToUpper();
|
Profiler profiler = new Profiler();
|
||||||
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Load insider transactions for {0} years>={1}", symbol,yearGreaterEqual));
|
try
|
||||||
InsiderTransactions insiderTransactions = MarketDataHelper.GetInsiderTransactionsYear(symbol, yearGreaterEqual);
|
|
||||||
if (null == insiderTransactions || 0 == insiderTransactions.Count)
|
|
||||||
{
|
{
|
||||||
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("No insider transactions for {0} years>={1}", symbol,yearGreaterEqual));
|
symbol = symbol.ToUpper();
|
||||||
return;
|
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Load insider transactions for {0} years>={1}", symbol,yearGreaterEqual));
|
||||||
|
InsiderTransactions insiderTransactions = MarketDataHelper.GetInsiderTransactionsYear(symbol, yearGreaterEqual);
|
||||||
|
if (null == insiderTransactions || 0 == insiderTransactions.Count)
|
||||||
|
{
|
||||||
|
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("No insider transactions for {0} years>={1}", symbol,yearGreaterEqual));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
MDTrace.WriteLine(LogLevel.DEBUG,$"{symbol} Done, took {profiler.End()}(ms)");
|
||||||
}
|
}
|
||||||
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.");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user