You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.0 KiB
34 lines
1.0 KiB
using log4net; |
|
using MethodDecorator.Fody.Interfaces; |
|
using Rougamo; |
|
using Rougamo.Context; |
|
using System.Reflection; |
|
|
|
namespace SparkClient.Model.Attributes |
|
{ |
|
[AttributeUsage(AttributeTargets.Method)] |
|
public class LogAttribute : MoAttribute |
|
{ |
|
private static readonly ILog Logger = LogManager.GetLogger(typeof(LogAttribute)); |
|
|
|
//public void OnEntry(MethodBase method) |
|
//{ |
|
// Logger.Debug($"Entering {method.DeclaringType?.Name}.{method.Name}"); |
|
//} |
|
|
|
//public void OnExit(MethodBase method) |
|
//{ |
|
// Logger.Debug($"Exiting {method.DeclaringType?.Name}.{method.Name}"); |
|
//} |
|
|
|
public override void OnEntry(MethodContext context) |
|
{ |
|
Logger.Debug($"Entering {context.Method.DeclaringType?.Name}.{context.Method.Name}"); |
|
} |
|
|
|
public override void OnExit(MethodContext context) |
|
{ |
|
Logger.Debug($"Exiting {context.Method.DeclaringType?.Name}.{context.Method.Name}"); |
|
} |
|
} |
|
}
|
|
|