本文整理汇总了C#中ILoggerService.Log方法的典型用法代码示例。如果您正苦于以下问题:C# ILoggerService.Log方法的具体用法?C# ILoggerService.Log怎么用?C# ILoggerService.Log使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ILoggerService
的用法示例。
在下文中一共展示了ILoggerService.Log方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Log
public static void Log(string message, TraceEventType severity, string category)
{
Trace.WriteLine(message);
string disable = ConfigurationManager.AppSettings["DisableLogging"];
if (string.IsNullOrWhiteSpace(disable) || disable == "false")
{
try
{
if (LoggerService == null)
{
// if someone hasn't overridden the default LoggerService before first Log, create one
LoggerService = new LoggerService();
LoggerService.Log(message, severity, category);
}
else
{
LoggerService.Log(message, severity, category);
}
}
catch (Exception ex)
{
LoggingFailure("EnterpriseLibrary logging error.", ex);
}
}
}
示例2: Start
public virtual void Start(string ip, int port)
{
logger = ServiceManager.Get<ILoggerService>();
semProc = ServiceManager.Get<ISemanticProcessor>();
listener = new HttpListener();
string url = IpWithPort(ip, port);
logger.Log("Listening on " + ip + ":" + port);
listener.Prefixes.Add(url);
listener.Start();
Task.Run(() => WaitForConnection(listener));
}