I have something that outputs what it thinks is the line and column numbers, but it's wrong since both are 0.
string ActivityLogPath = Program.InputField("ActivityLogPath").Value;
Action<string>
Log = (string logtext) => {
var LineNumber = (new System.Diagnostics.StackFrame(1)).GetFileLineNumber();
var ColumnNumber = (new System.Diagnostics.StackFrame(1)).GetFileColumnNumber();
//string text = DateTime.Now.ToString("yyyyMMdd HH:mm:ss.fffffffzzz") + " : " + logtext + "
";
string text = DateTime.Now.ToString("yyyyMMdd HH:mm:ss.fffffffzzz") + " : " + logtext + " (" + LineNumber.ToString() + ", " + ColumnNumber + ")" + "
";
System.IO.File.AppendAllText(ActivityLogPath, text);
};
When.ModuleParameterIsChanging((module, parameter) =>
{
string logtext = module.Instance.Name + " : " + parameter.Name + " : " + parameter.Value;
Log(logtext);
return true;
});
Program.GoBackground();
From what I understand, these commands only work if the code is in DEBUG mode. Is it in RELEASE at this point?