On Sep 12, 3:08 pm, "Mufasa" <j...@nowhere.comwrote:
Is there anyway to generate a string that contains the name of the
namespace, the object name and then the function/procedure name that is
currently running.
I want to use this for logging information and am getting tired of having to
type/cut-paste the things.
If I can't get it all, can I get at least some of it?
TIA - Jeff.
Here is a C# example:
static void Main(string[] args)
{
System.Diagnostics.StackFrame sf = new
System.Diagnostics.StackFrame(true);
string fileName = sf.GetFileName();
string lineNumber = sf.GetFileLineNumber().ToString();
string methodName = sf.GetMethod().Name;
string output = string.Format("File name={0} , Line
number={1} , Method name={2}", fileName, lineNumber, methodName);
Console.WriteLine(output);
}