title: Best way to log an override method
body: <p>Taking the example of <a href="http://www.dotnetperls.com/override" rel="nofollow">DotNetPerls</a></p>
  
  <pre><code>class A
  {
      public virtual void Y()
      {
          Console.WriteLine("A.Y");
      }
  }
  
  class B : A
  {
      public override void Y()
      {
          Console.WriteLine("B.Y");
      }
  }
  </code></pre>
  
  <p>How can I safely call a method in the <code>Y</code> method, for example, to log some action, without the need to edit every single implementation?</p>
  
  <p>I know the <code>virtual</code> makes the method overridable and that the original method is never called unless you use the <code>base</code> caller, I also investigated a bit about <a href="https://www.postsharp.net" rel="nofollow">PostSharp</a> but does not seem to help here...</p>
  
  <p>Just trying to get my head around in order log some calls without the need to edit each and ever implementation :(</p>