///------------------------------------------------------------------------------------------------- /// <summary> /// Logs the given message. /// </summary> /// <param name="message"> /// The message. /// </param> ///------------------------------------------------------------------------------------------------- public void Log(DiagnosticMessage message) { Contract.Requires(message != null, "message"); _context.Log(message); }
/// <summary> /// Une erreur est survenue pendant la notification d'un événement. /// </summary> /// <param name="log"></param> /// <param name="ex"></param> private static void NotifyEventError(ISessionContext log, Exception ex) { Contract.Requires(log, "log"); log.Log(new DiagnosticMessage(MessageType.Error, ex.Message, "Notifications", false, null, ex)); }
///------------------------------------------------------------------------------------------------- /// <summary> /// Creates error message. /// </summary> /// <param name="message"> /// The message. /// </param> /// <param name="propertyName"> /// (Optional) The name of the property. /// </param> /// <param name="ex"> /// (Optional) the ex. /// </param> ///------------------------------------------------------------------------------------------------- public void CreateErrorMessage(string message, string propertyName = null, Exception ex = null) { _sessionContext.Log(new DiagnosticMessage(MessageType.Error, MessageHelper.CreateMessage(message, Element), _category, true, Element, ex, propertyName ?? PropertyName)); }
///------------------------------------------------------------------------------------------------- /// <summary> /// Logs a message. /// </summary> /// <param name="message"> /// The message. /// </param> ///------------------------------------------------------------------------------------------------- public void Log(DiagnosticMessage message) { Contract.Requires(message, "message"); _log.Log(message); }