Created
          December 17, 2012 04:03 
        
      - 
      
- 
        Save floydpink/4315686 to your computer and use it in GitHub Desktop. 
    The main method that does the AOP magic
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | public void Intercept(IInvocation invocation) | |
| { | |
| if (Log.IsDebugEnabled) Log.Debug(CreateInvocationLogString("Called", invocation)); | |
| try | |
| { | |
| invocation.Proceed(); | |
| if (Log.IsDebugEnabled) | |
| if (invocation.Method.ReturnType != typeof(void)) | |
| Log.Debug("Returning with: " + invocation.ReturnValue); | |
| } | |
| catch (Exception ex) | |
| { | |
| if (Log.IsErrorEnabled) Log.Error(CreateInvocationLogString("ERROR", invocation), ex); | |
| throw; | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment