本文整理汇总了C#中ILogger.Submit方法的典型用法代码示例。如果您正苦于以下问题:C# ILogger.Submit方法的具体用法?C# ILogger.Submit怎么用?C# ILogger.Submit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ILogger
的用法示例。
在下文中一共展示了ILogger.Submit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Manager
public Manager()
{
_log = LogFactory.Instance.GetLogger(GetType());
_log.Submit(LogLevel.Info, "Setting up configuration store");
ConfigurationStore = new Store();
_log.Submit(LogLevel.Info, "Configuration store setup finished");
_log.Submit(LogLevel.Info, "Setting up Data Manager");
DataManager = new DataManager(ConfigurationStore);
_log.Submit(LogLevel.Info, "Data Manager setup finished");
}
示例2: Main
private static void Main(string[] args)
{
LogFactory.ForceConsoleMode = true;
_log = LogFactory.Instance.GetLogger(typeof(Startup));
if (args.Length >= 1 && args.Any(a => a == "-d"))
{
IConsole console = ConsoleFactory.GetConsole();
console.StartAndWait();
}
else if (args.Length >= 1 && args.Any(a => a == "-s"))
{
IConsole console = ConsoleFactory.GetConsole();
console.Stop();
}
else
{
Manager m;
try
{
m = new Manager();
m.Start();
}
catch (Exception e)
{
_log.Submit(LogLevel.Fatal, "An error occurred when starting server!");
_log.SubmitException(e);
return;
}
_log.Submit(LogLevel.Info, new string('-', 70));
_log.Submit(LogLevel.Info, "Nugetory started! Press [ENTER] to stop...");
_log.Submit(LogLevel.Info, new string('-', 70));
System.Console.ReadLine();
m.Stop();
}
}