get Elapsed property in Interceptor
alextroto opened this issue · 8 comments
alextroto commented
Hi,
There are cases where high-resolution accuracy it's need it, so it would be great to get Elapsed property in Interceptor.
SimonCropp commented
how would this be done in a non breaking way?
alextroto commented
Maybe a new Interceptor ?
public static class MethodTimeHiResLogger
{
public static void Log(MethodBase methodBase, TimeSpan elapsed)
{
//Do some logging here
}
}
SimonCropp commented
That sounds reasonable. Can you submit a PR.
alextroto commented
I'm not very familiar with Fody but I'll try to understand how it's working.
In the meantime, if someone can submit a PR, it would be great.
GeertvanHorrik commented
Instead of adding a different class, why not add this (optional!) method:
public static void Log(MethodBase methodBase, TimeSpan duration, string message)
{
//Do some logging here
}
The weaver can auto-detect whether it's available or not.
SimonCropp commented
@GeertvanHorrik happy with that
GeertvanHorrik commented
Cool, I will try to find time beginning next week to implement his.
SimonCropp commented
thanks to @GeertvanHorrik this is now implemented. it is also deployed to nuget