NET Logging Library
PopMethod Method (Log)
Example 



KellermanSoftware.NetLoggingLibrary Namespace > Log Class : PopMethod Method
Pop a method from the stack and measure the performance
Syntax
Public Shared Function PopMethod( _
   ByVal className As String, _
   ByVal methodName As String _
) As LogResponse
Dim className As String
Dim methodName As String
Dim value As LogResponse
 
value = Log.PopMethod(className, methodName)
public static LogResponse PopMethod( 
   string className,
   string methodName
)
public:
static LogResponse^ PopMethod( 
   String^ className,
   String^ methodName
) 

Parameters

className
methodName
Example
//Licensed Mode
//Log.UserName = "User Name From Receipt";
//Log.LicenseKey = "LicenseKey From Receipt";            
 
//Clear all configuration
Log.ResetConfiguration();
 
//Add a new target, you can also define targets in an xml file, app.config, or web.config
FileTarget fileTarget = new FileTarget(Environment.CurrentDirectory + "\\fileLogger.txt");
Log.Config.Targets.Add(fileTarget);
 
//Parameters
string className = "ClassTest";
string methodName = "MethodTest";
 
//Push a method to the stack for timing purposes
//This is a way of measuring performance for sections or methods
Log.PushMethod(className, methodName);
 
//Log a normal message
Log.Debug("This is a test");
 
//Wait a second to show the performance timing
System.Threading.Thread.Sleep(1000);
 
//Pop a method from the stack for timing purposes
Log.PopMethod(className,methodName);
'Licensed Mode
'Log.UserName = "User Name From Receipt";
'Log.LicenseKey = "LicenseKey From Receipt";            
 
'Clear all configuration
Log.ResetConfiguration()
 
'Add a new target, you can also define targets in an xml file, app.config, or web.config
Dim fileTarget As New FileTarget(Environment.CurrentDirectory & "\fileLogger.txt")
Log.Config.Targets.Add(fileTarget)
 
'Parameters
Dim className As String = "ClassTest"
Dim methodName As String = "MethodTest"
 
'Push a method to the stack for timing purposes
'This is a way of measuring performance for sections or methods
Log.PushMethod(className, methodName)
 
'Log a normal message
Log.Debug("This is a test")
 
'Wait a second to show the performance timing
System.Threading.Thread.Sleep(1000)
 
'Pop a method from the stack for timing purposes
Log.PopMethod(className,methodName)
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

Log Class
Log Members