-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLoggerAttribute.cs
More file actions
40 lines (34 loc) · 1.34 KB
/
Copy pathLoggerAttribute.cs
File metadata and controls
40 lines (34 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System;
using System.Linq;
using System.Runtime.CompilerServices;
using NETMetaCoder.Abstractions;
namespace NETMetaCoder.TestApp
{
public class LoggerAttribute : NETMetaCoderAttribute
{
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
public override void Init(bool async, Type containerType, Type returnType, string methodName,
Type[] parameterTypes)
{
Console.WriteLine("in logger init");
var pt = parameterTypes.Aggregate("", (acc, t) => $"{acc}, {t.Name}");
Console.WriteLine(
$"async={async}, returnType={returnType.Name}, methodName={methodName}, parameterTypes={pt}");
}
public override InterceptionResult Intercept(object[] arguments)
{
return InterceptionResult.NotIntercepted();
}
public override InterceptionResult<TValue> Intercept<TValue>(object[] arguments, ref TValue value)
{
return InterceptionResult<TValue>.NotIntercepted();
}
public override void HandleInterceptionResult(ref InterceptionResult interceptionResult)
{
}
public override void HandleInterceptionResult<TValue>(ref TValue value,
ref InterceptionResult<TValue> interceptionResult)
{
}
}
}