public void ThreadCallback() { SmartLoggerPerType.Log(SmartLogLevel.Trace, SmartLogLine.GetLine("Starting", SmartLogGeneratorName, ToString())); AssertGetSmartLog(SmartLogLevel.Trace, SmartLogLevel.Debug); AssertGetSmartLog(SmartLogLevel.Debug, SmartLogLevel.Debug); AssertGetSmartLog(SmartLogLevel.Warn, SmartLogLevel.Debug); AssertGetSmartLog(SmartLogLevel.Info, SmartLogLevel.Debug); AssertGetSmartLog(SmartLogLevel.Error, SmartLogLevel.Debug); AssertGetSmartLog(SmartLogLevel.Critical, SmartLogLevel.Debug); SmartLoggerPerType.Log(SmartLogLevel.Trace, SmartLogLine.GetLine("Complited", SmartLogGeneratorName, ToString())); Write(); ManualResetEvent.Set(); }
public static SmartLogPerTypeByLevel <T> Log <T>(this SmartLoggerPerType <T> smartLoggerPerType, string action, SmartLogLevel smartLogLevel, string message) { string line = SmartLogLine.GetLine(action, smartLogLevel.ToLine(), message); SmartLogPerTypeByLevel <T> smartLogPerTypeByLevel = smartLoggerPerType.Log(smartLogLevel, line); return(smartLogPerTypeByLevel); }
private void AssertGetSmartLog(SmartLogLevel smartLogLevel, SmartLogLevel logLevel) { SmartLoggerPerType.TryGetValue(typeof(SmartLoggerTests), out SmartLogPerTypeByLevel <SmartLoggerTests> expectedSmartLogPerTypeByLevel); SmartLogPerTypeByLevel <SmartLoggerTests> smartLogPerTypeByLevel = AssertGetSmartLog(Getting, smartLogLevel, expectedSmartLogPerTypeByLevel); Thread.Sleep(100); LogSize(smartLogLevel); string line = SmartLogLine.GetLine(logLevel.ToLine(), SmartLogGeneratorName, smartLogLevel.ToLine()); smartLogPerTypeByLevel.Log(logLevel, line); Thread.Sleep(100); }
private void LogSize(SmartLogLevel smartLogLevel) { SmartLoggerPerType.TryGetValue(typeof(SmartLoggerTests), out SmartLogPerTypeByLevel <SmartLoggerTests> smartLogPerTypeByLevel); Assert.NotNull(smartLogPerTypeByLevel); smartLogPerTypeByLevel.TryGetValue(smartLogLevel, out SmartLogLines smartLogLines); Assert.NotNull(smartLogLines); string line = SmartLogLine.GetLine(SmartLogGeneratorName, Size, smartLogPerTypeByLevel.Size().ToString()); smartLogPerTypeByLevel.Log(smartLogLevel, line); Assert.IsNotEmpty(smartLogLines); Thread.Sleep(100); }