NET Logging Library
PushMethod Method (ConcreteLog)
Example 



KellermanSoftware.NetLoggingLibrary Namespace > ConcreteLog Class : PushMethod Method
Push a method on to the stack to measure performance
Syntax
Public Function PushMethod( _
   ByVal className As String, _
   ByVal methodName As String _
) As LogResponse
Dim instance As ConcreteLog
Dim className As String
Dim methodName As String
Dim value As LogResponse
 
value = instance.PushMethod(className, methodName)
public LogResponse PushMethod( 
   string className,
   string methodName
)
public:
LogResponse^ PushMethod( 
   String^ className,
   String^ methodName
) 

Parameters

className
methodName
Example
ConcreteLog logger = new ConcreteLog();
 
//Licensed Mode
//logger.UserName = "User Name From Receipt";
//logger.LicenseKey = "LicenseKey From Receipt";            
 
//Clear all configuration
logger.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");
logger.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
logger.PushMethod(className, methodName);
 
//Log a normal message
logger.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
logger.PopMethod(className,methodName);
Dim logger As New ConcreteLog()
 
'Licensed Mode
'logger.UserName = "User Name From Receipt";
'logger.LicenseKey = "LicenseKey From Receipt";            
 
'Clear all configuration
logger.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")
logger.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
logger.PushMethod(className, methodName)
 
'Log a normal message
logger.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
logger.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

ConcreteLog Class
ConcreteLog Members