public static void WriteCritical(SourceInfo logSourceInfo, TextBox textbox, BackgroundExecutorWithStatus bgws, string msg, params object[] args) { LogInternal(logSourceInfo, TraceEventType.Critical, msg, args); UpdateUiTextbox(bgws, textbox, msg, args); }
public static void WriteCritical(SourceInfo logSourceInfo, string msg, params object[] args) { LogInternal(logSourceInfo, TraceEventType.Critical, msg, args); }
private static void LogInternal(SourceInfo logSourceInfo, TraceEventType traceType, string msg, params object[] args) { if (!TraceSource.Switch.ShouldTrace(traceType)) return; if (args.Length != 0) { msg = string.Format(msg, args); } string methodName = logSourceInfo.MethodName; int lineNumber = logSourceInfo.LineNumber; string fileName = logSourceInfo.FileName; string background = Thread.CurrentThread.IsBackground ? "Background Thread" : "UI Thread"; string thread = $"(T{Thread.CurrentThread.ManagedThreadId:x4})"; string logInfo = string.Format(CultureInfo.InstalledUICulture, "{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}", DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss"), background, thread, fileName, methodName, lineNumber, traceType, msg); Trace.WriteLine(logInfo); }
public static void WriteCritical(SourceInfo logSourceInfo, TextBox textbox, string msg, params object[] args) { LogInternal(logSourceInfo, TraceEventType.Critical, msg, args); UpdateUiTextbox(textbox, msg, args); }
public static void WriteInformation(SourceInfo logSourceInfo, string msg, params object[] args) { LogInternal(logSourceInfo, TraceEventType.Information, msg, args); }
public static void WriteWarning(SourceInfo logSourceInfo, string msg, params object[] args) { LogInternal(logSourceInfo, TraceEventType.Warning, msg, args); }
public static void WriteVerbose(SourceInfo logSourceInfo, string msg, params object[] args) { LogInternal(logSourceInfo, TraceEventType.Verbose, msg, args); }
public static void WriteInformation(SourceInfo logSourceInfo, TextBox textbox, BackgroundExecutorWithStatus bgws, string msg, params object[] args) { LogInternal(logSourceInfo, TraceEventType.Information, msg, args); UpdateUiTextbox(bgws, textbox, msg, args); }
public static void WriteInformation(SourceInfo logSourceInfo, TextBox textbox, string msg, params object[] args) { LogInternal(logSourceInfo, TraceEventType.Information, msg, args); UpdateUiTextbox(textbox, msg, args); }