Пример #1
0
        /// <summary>
        /// Logs the before call data.
        /// </summary>
        /// <param name="input">Object representing the inputs to the current call to the target.</param>
        /// <param name="callData">The additional audit data about the call.</param>
        void LogBeforeCallData(
            IMethodInvocation input,
            CallTraceData callData)
        {
            if (callData.BeforeCallLogEntry == null)
            {
                return;
            }

            // build the call message:
            using (var writer = new StringWriter(CultureInfo.InvariantCulture))
            {
                writer.Indent(1);

                DoDumpBeforeCall(writer, input, callData);

                writer.Unindent(1);
                writer.WriteLine();

                // get the message
                callData.BeforeCallLogEntry.Message = writer.GetStringBuilder().ToString();
            }

            // log the event entry
            LogWriter.Write(callData.BeforeCallLogEntry);
        }