このヘルパーを使用して、ログ記録のために現在実行されているメソッドの名前を解決しています。
[MethodImpl(MethodImplOptions.NoInlining)]
public static string GetCurrentMethod()
{
StackTrace st = new StackTrace();
StackFrame sf = st.GetFrame(1);
return sf.GetMethod().Name;
}
これは返される文字列です<Frequency>b__46
" b__46 はどういう意味ですか? また、「周波数」という単語を取得する方法はありますか?
これはヘルパーを呼び出しています。
return ProxyCallWrapper.Execute<bool, IBackendJob>((backend, header) =>
{
header.CorrelationID = CorrelationID;
logger.LogInfo(string.Format("### BSL CALL from {0} by {1} : CorrelationID: {2}", this.ToString(), GetCurrentMethod() ,header.CorrelationID));
return backend.AddJob(header, jobId);
});