private void DisposeLoggers() { _eventLog?.Dispose(); _eventLog = null; _messageLog?.Dispose(); _messageLog = null; }
public void Dispose() { logger.LogDebug("Disposing UtilityBase"); this.host.Dispose(); logger.LogDebug("CloseAndFlush Logging"); serilogLogger.Dispose(); }
public void Dispose() { _diagnosticNotifier?.Dispose(); _server.Dispose(); _logger.Dispose(); }
public static void CloseAndFlush() { if (serilogLogger != null) { serilogLogger.Dispose(); } _LoggerFactory = null; }
public static void CloseUartLog() { if (uartLogFile == null) { return; } uartLogFile.Dispose(); uartLogFile = null; }
public static void CloseLuaLog() { if (luaLogFile == null) { return; } luaLogFile.Dispose(); luaLogFile = null; }
protected virtual void Dispose(bool disposing) { if (_disposed || !disposing) { return; } _logger?.Dispose(); _logger = null; _disposed = true; }
private bool disposedValue = false; // To detect redundant calls protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { factory.Dispose(); } disposedValue = true; } }
/// <summary> /// Destroy the resource. /// </summary> /// <param name="disposing">disposing</param> protected virtual void Dispose(bool disposing) { if (!disposed) { if (disposing) { } fileLogger.Dispose(); disposed = true; } }
/// <summary> /// Setting dispose /// </summary> /// <param name="disposing">Disposing value</param> private void Dispose(bool disposing) { if (_disposed) { return; } if (disposing) { if (_logger != null) { _logger.Dispose(); _disposed = true; } } }
public virtual void ScriptFinished(ScriptFinishedEventArgs.ScriptFinishedResult result, string error = null) { engineLogger.Information("Result Code: " + result.ToString()); if (error == null) { engineLogger.Information("Error: None"); } else { engineLogger.Information("Error: " + error); } engineLogger.Dispose(); CurrentStatus = EngineStatus.Finished; ScriptFinishedEventArgs args = new ScriptFinishedEventArgs(); args.LoggedOn = DateTime.Now; args.Result = result; args.Error = error; args.ExecutionTime = sw.Elapsed; args.FileName = FileName; Core.Sockets.SocketClient.SendExecutionLog("Result Code: " + result.ToString()); Core.Sockets.SocketClient.SendExecutionLog("Total Execution Time: " + sw.Elapsed); //convert to json var serializedArguments = Newtonsoft.Json.JsonConvert.SerializeObject(args); //write execution metrics if ((engineSettings.TrackExecutionMetrics) && (FileName != null)) { var summaryLogger = new Logging().CreateJsonLogger("Execution Summary", Serilog.RollingInterval.Infinite); summaryLogger.Information(serializedArguments); summaryLogger.Dispose(); } ScriptFinishedEvent?.Invoke(this, args); }
public void Dispose() { _serilogLogger?.Dispose(); }
public virtual void ScriptFinished(ScriptFinishedEventArgs.ScriptFinishedResult result, string error = null) { engineLogger.Information("Result Code: " + result.ToString()); //add result variable if missing var resultVar = VariableList.Where(f => f.VariableName == "taskt.Result").FirstOrDefault(); //handle if variable is missing if (resultVar == null) { resultVar = new Script.ScriptVariable() { VariableName = "taskt.Result", VariableValue = "" }; } //check value var resultValue = resultVar.VariableValue.ToString(); if (error == null) { engineLogger.Information("Error: None"); if (taskModel != null && serverSettings.ServerConnectionEnabled) { HttpServerClient.UpdateTask(taskModel.TaskID, "Completed", "Script Completed Successfully"); } if (string.IsNullOrEmpty(resultValue)) { TasktResult = "Successfully Completed Script"; } else { TasktResult = resultValue; } } else { engineLogger.Information("Error: " + error); if (taskModel != null) { HttpServerClient.UpdateTask(taskModel.TaskID, "Error", error); } TasktResult = error; } engineLogger.Dispose(); CurrentStatus = EngineStatus.Finished; ScriptFinishedEventArgs args = new ScriptFinishedEventArgs(); args.LoggedOn = DateTime.Now; args.Result = result; args.Error = error; args.ExecutionTime = sw.Elapsed; args.FileName = FileName; Core.Server.SocketClient.SendExecutionLog("Result Code: " + result.ToString()); Core.Server.SocketClient.SendExecutionLog("Total Execution Time: " + sw.Elapsed); //convert to json var serializedArguments = Newtonsoft.Json.JsonConvert.SerializeObject(args); //write execution metrics if ((engineSettings.TrackExecutionMetrics) && (FileName != null)) { var summaryLogger = new Logging().CreateJsonLogger("Execution Summary", Serilog.RollingInterval.Infinite); summaryLogger.Information(serializedArguments); summaryLogger.Dispose(); } Core.Client.EngineBusy = false; if (serverSettings.ServerConnectionEnabled) { HttpServerClient.CheckIn(); } ScriptFinishedEvent?.Invoke(this, args); }
public void Dispose() { _sLogger.Dispose(); }
public void Dispose() => _logger.Dispose();
public void Dispose() { _logger?.Dispose(); }