public void Log(String toLog, String msg = null, String userDirectory = null) { worker.Enqueue(() => { InnerLog(toLog, msg, userDirectory); }, reseter); }
public void Log(object msg) { if (haveToBeSend) { //Store to send and delete } switch (logMode) { case LogMode.NONE: break; case LogMode.CONSOLE: Console(msg.ToString()); break; case LogMode.EXTERNAL: break; case LogMode.CURRENT_FOLDER: CurrentFolder(msg.ToString()); break; case LogMode.TEMP_FOLDER: break; default: break; } #if DEBUG switch (alertMode) { case AlertMode.NONE: break; case AlertMode.CONSOLE: System.Console.ForegroundColor = ConsoleColor.Red; Console(ALERT + msg.ToString()); System.Console.ForegroundColor = ConsoleColor.Black; break; case AlertMode.TOAST: break; case AlertMode.MESSAGE_BOX: MessageBox(ALERT + msg.ToString()); break; case AlertMode.OVERLAY: ManualResetEvent reset = new ManualResetEvent(false); commandWorker.Enqueue(() => { this.manualResetEvent = reset; this.haveToRun = true; this.cancellationTS = new CancellationTokenSource(); Overlay(msg.ToString(), reset); }, reset); break; default: break; } #else switch (alertMode) { default: break; } #endif }