Exemplo n.º 1
0
        internal TLogData CreateLogData(IContainer container, InvocationRawData invocationRawData)
        {
            TLogData logData = Activator.CreateInstance <TLogData>();

            _logDataPrepareAction?.Invoke(container, new InvocationData(invocationRawData, _paramNameToIndexMapping), logData);
            return(logData);
        }
Exemplo n.º 2
0
        public void ProcessInvocationData(InvocationRawData invocationRawData)
        {
            if (_config.LogOutput == null)
            {
                throw new WriterNotSetException();
            }

            foreach (var methodConfig in _config.GetConfigsForMethod(invocationRawData.MethodInfo))
            {
                if (methodConfig.ShouldBeLogged(_container, invocationRawData))
                {
                    _config.LogOutput.WriteLog(methodConfig.CreateLogData(_container, invocationRawData));
                }
            }
        }
Exemplo n.º 3
0
 public ArgumentsCollection(InvocationRawData invocationRawData, Dictionary <string, int> paramNameToIndexMapping)
 {
     _invocationRawData       = invocationRawData;
     _paramNameToIndexMapping = paramNameToIndexMapping;
 }
Exemplo n.º 4
0
 internal bool ShouldBeLogged(IContainer container, InvocationRawData invocationRawData)
 {
     return(_conditions.All(c => c(container, new InvocationData(invocationRawData, _paramNameToIndexMapping))));
 }
 public InvocationData(InvocationRawData raw, Dictionary <string, int> paramNameToIndexMapping)
 {
     Raw       = raw;
     Arguments = new ArgumentsCollection(raw, paramNameToIndexMapping);
 }