本文整理汇总了C#中Logger.Initialise方法的典型用法代码示例。如果您正苦于以下问题:C# Logger.Initialise方法的具体用法?C# Logger.Initialise怎么用?C# Logger.Initialise使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Logger
的用法示例。
在下文中一共展示了Logger.Initialise方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public bool Execute()
{
var message = string.Format("Costura.EmbedTask v{0} Executing (Change MessageImportance to get more or less info)", version);
var buildMessageEventArgs = new BuildMessageEventArgs(message, "", "EmbedTask", Microsoft.Build.Framework.MessageImportance.High);
BuildEngine.LogMessageEvent(buildMessageEventArgs);
var stopwatch = Stopwatch.StartNew();
try
{
logger = new Logger
{
BuildEngine = BuildEngine,
};
logger.Initialise(MessageImportance);
Inner();
}
catch (Exception exception)
{
HandleException(exception);
}
finally
{
stopwatch.Stop();
logger.Flush();
BuildEngine.LogMessageEvent(new BuildMessageEventArgs(string.Format("\tFinished ({0}ms)", stopwatch.ElapsedMilliseconds), "", "Costura.EmbedTask", Microsoft.Build.Framework.MessageImportance.High));
}
return !logger.ErrorHasBeenRaised;
}
示例2: Execute
public override bool Execute()
{
BuildEngine.LogMessageEvent(new BuildMessageEventArgs(string.Format("NotifyPropertyWeaver (version {0}) Executing (Change MessageImportance to get more or less info)", GetType().Assembly.GetName().Version), "", "NotifyPropertyWeaver", Microsoft.Build.Framework.MessageImportance.High));
var lastVersionMessage = "Version 2.1 will be the last version of NotifyPropertyWeaver. No more updates will be published. Please move over to Fody and the PropertyChanged addin.";
BuildEngine.LogWarningEvent(new BuildWarningEventArgs("","","",0,0,0,0,lastVersionMessage, "", "NotifyPropertyWeaver"));
var stopwatch = Stopwatch.StartNew();
try
{
logger = new Logger
{
SenderName = "NotifyPropertyWeaver",
BuildEngine = BuildEngine,
};
logger.Initialise(MessageImportance);
Inner();
}
catch (Exception exception)
{
HandleException(exception);
}
finally
{
stopwatch.Stop();
logger.Flush();
BuildEngine.LogMessageEvent(new BuildMessageEventArgs(string.Format("\tFinished ({0}ms)", stopwatch.ElapsedMilliseconds), "", "NotifyPropertyWeaver", Microsoft.Build.Framework.MessageImportance.High));
}
return !logger.ErrorHasBeenRaised;
}