/// <summary> /// Writes to the log /// </summary> /// <param name="message">Main message</param> /// <param name="category">Category of the logged event</param> public static void Write(string message, LoggerCategories category) { try { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write( message, category.ToString(), (int)_defaultPriority, (int)category, // ID is set to logger category TraceEventType.Information, "Trace"); } catch { /* Do nothing. The logger should not throw an exception while trying to log another exception */ } }
/// <summary> /// Writes to the log /// </summary> /// <param name="title">Title of the log entry</param> /// <param name="message">Main message</param> /// <param name="priority">Priority of the logged event</param> /// <param name="category">Category of the logged event</param> /// <param name="type">Type of logged event</param> public static void Write(string title, string message, LoggerPriorities priority, LoggerCategories category, TraceEventType type) { try { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write( message, category.ToString(), (int)priority, (int)category, // ID is set to logger category type, title); } catch { /* Do nothing. The logger should not throw an exception while trying to log another exception */ } }