简体   繁体   English

使用 postsharp 如何自定义 OnEntry 日志文本?

[英]Using postsharp how to customize OnEntry logging text?

How to customize postsharp logging text inside onEntry method in c#.如何在 c# 的 onEntry 方法中自定义 postsharp 日志记录文本。 Look at the screenshot, here first line is mehod_abc starting.看截图,这里第一行是 mehod_abc 开始。 In next line I can see the total execution time.在下一行,我可以看到总执行时间。 I want to eliminate the line 'starting..'.我想消除“开始......”这一行。 How can I customize this?我该如何定制这个? 在此处输入图像描述

Currently (in version 6.8) PostSharp Logging doesn't support this level of customization.目前(在 6.8 版中)PostSharp Logging 不支持这种级别的自定义。 As an alternative you can use a custom profiling aspect to measure and log the execution time of methods.作为替代方案,您可以使用自定义分析方面来测量和记录方法的执行时间。

You can start with our sample and modify it for your requirements: https://samples.postsharp.net/f/PostSharp.Samples.Profiling/您可以从我们的示例开始并根据您的要求对其进行修改: https://samples.postsharp.net/f/PostSharp.Samples.Profiling/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM