public void LogWarning(Runtime.WarningID ID, string message, string filename, int line, int col) { filename = filename ?? string.Empty; if (!runtimeCore.Options.IsDeltaExecution && (string.IsNullOrEmpty(filename) || line == Constants.kInvalidIndex || col == Constants.kInvalidIndex)) { AuditCodeLocation(ref filename, ref line, ref col); } var warningMsg = string.Format(Resources.kConsoleWarningMessage, message, filename, line, col); if (runtimeCore.Options.Verbose) { System.Console.WriteLine(warningMsg); } if (WebMessageHandler != null) { var outputMessage = new OutputMessage(warningMsg); WebMessageHandler.Write(outputMessage); } if (MessageHandler != null) { var outputMessage = new OutputMessage(OutputMessage.MessageType.Warning, message.Trim(), filename, line, col); MessageHandler.Write(outputMessage); } AssociativeGraph.GraphNode executingGraphNode = null; var executive = runtimeCore.CurrentExecutive.CurrentDSASMExec; if (executive != null) { executingGraphNode = executive.Properties.executingGraphNode; // In delta execution mode, it means the warning is from some // internal graph node. if (executingGraphNode != null && executingGraphNode.guid.Equals(System.Guid.Empty)) { executingGraphNode = runtimeCore.DSExecutable.RuntimeData.ExecutingGraphnode; } } var entry = new Runtime.WarningEntry { ID = ID, Message = message, Column = col, Line = line, ExpressionID = runtimeCore.RuntimeExpressionUID, GraphNodeGuid = executingGraphNode == null ? Guid.Empty : executingGraphNode.guid, AstID = executingGraphNode == null ? Constants.kInvalidIndex : executingGraphNode.OriginalAstID, Filename = filename }; warnings.Add(entry); }
public void LogWarning(RuntimeData.WarningID ID, string message, string filename, int line, int col) { filename = filename ?? string.Empty; if (!this.core.Options.IsDeltaExecution && (string.IsNullOrEmpty(filename) || line == Constants.kInvalidIndex || col == Constants.kInvalidIndex)) { CodeGen.AuditCodeLocation(core, ref filename, ref line, ref col); } var warningMsg = string.Format(WarningMessage.kConsoleWarningMessage, message, filename, line, col); if (core.Options.Verbose) { System.Console.WriteLine(warningMsg); } if (WebMessageHandler != null) { var outputMessage = new OutputMessage(warningMsg); WebMessageHandler.Write(outputMessage); } if (MessageHandler != null) { var outputMessage = new OutputMessage(OutputMessage.MessageType.Warning, message.Trim(), filename, line, col); MessageHandler.Write(outputMessage); } var entry = new RuntimeData.WarningEntry { ID = ID, Message = message, Column = col, Line = line, ExpressionID = core.RuntimeExpressionUID, GraphNodeGuid = core.ExecutingGraphnode == null ? Guid.Empty : core.ExecutingGraphnode.guid, Filename = filename }; warnings.Add(entry); if (core.Options.IsDeltaExecution) { } }