/// <summary> /// Writes the specified log data. /// </summary> /// <param name="logData">The log data.</param> /// <param name="operationType">Type of the operation.</param> /// <param name="customOperationName">Name of the custom operation.</param> public void Write(object logData, OperationType operationType, string customOperationName = null) { EnsureNotDisposed(); if (operationType == OperationType.Custom) { Guard.ArgumentNotNullOrEmpty(customOperationName, "customOperationName"); } var operation = customOperationName; if (operationType != OperationType.Custom) { operation = operationType.ToString(); } var item = new AuditLogEntryItem(operation, Guid.NewGuid().ToString(), 1) { LogData = logData }; logEntry.Items.Add(item); }
/// <summary> /// Gets the audit log formatter. /// </summary> /// <param name="logEntryItem">The log entry item.</param> /// <returns> /// The AuditLogFormatter to format the given <see cref="T:Cedar.Framwork.AuditTrail.AuditLogEntryItem" />'s log /// data. /// </returns> protected virtual IAuditLogFormatter GetAuditLogFormatter(AuditLogEntryItem logEntryItem) { Guard.ArgumentNotNull(logEntryItem, "logEntryItem"); return AuditLogFormatters.GetFormatter(logEntryItem.LogData); }