本文整理汇总了C#中ILogger.logError方法的典型用法代码示例。如果您正苦于以下问题:C# ILogger.logError方法的具体用法?C# ILogger.logError怎么用?C# ILogger.logError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ILogger
的用法示例。
在下文中一共展示了ILogger.logError方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: QuiddlerSvr
/// <summary>
/// Constructor
/// </summary>
public QuiddlerSvr()
{
InitializeComponent();
try
{
// Create a logger object
logger = new Logger("Quiddler_Server.log", LoggingMode.Debug);
// Get public server machine address
conn = new Connection();
// Load server sounds
sounds = new AudioDeck();
sounds.Add("serverStart", "{path_here}");
sounds.Add("serverStop", "{path_here}");
}
catch (Exception ex)
{
logger.logError(ex.Message);
UpdateStatus(ex.Message);
}
}
示例2: QuiddlerService
/// <summary>
/// Constructor
/// </summary>
public QuiddlerService()
{
try
{
// Create a StreamWriter object for logging events
logger = new Logger("Quiddler_Service.log", LoggingMode.Debug);
// Load configuration settings
settings = new QuiddlerConfig("Resources/gameConfig.xml");
// Initialize members
users = new Dictionary<int, UserDC>();
clients = new Dictionary<int, ICallback>();
deck = new Deck();
words = new Words(WordSource.TextFile, "Resources/Data/Words.txt");
// Log success
logger.logInfo("Service created");
}
catch (FileLoadException ex)
{
logger.logError(ex.Message);
throw ex;
}
catch (FileNotFoundException ex)
{
logger.logError(ex.Message);
throw ex;
}
catch (OleDbException ex)
{
logger.logError(ex.Message);
throw ex;
}
catch (Exception ex)
{
logger.logError(ex.Message);
throw ex;
}
}