设置记录器详细程度

时间:2013-04-02 11:06:13

标签: c# logging

有人可以帮我设置Logger详细程度吗? http://msdn.microsoft.com/en-us/library/microsoft.build.utilities.logger.verbosity(v=vs.100).aspx

logger.Verbosity = "Normal";
//doesn't work

logger.Verbosity = 1;
//doesn't work

3 个答案:

答案 0 :(得分:2)

您必须使用LoggerVerbosity - 枚举:

using Microsoft.Build.Framework;

// ...
logger.Verbosity = LoggerVerbosity.Minimal; // For example (see link for more values).

答案 1 :(得分:0)

试试这个:

logger.Verbosity = LoggerVerbosity.Normal

答案 2 :(得分:0)

要设置Normal详细程度,您需要:

logger.Verbosity = Microsoft.Build.Framework.LoggerVerbosity.Normal;