Esempio n. 1
0
        public static T Create(T decorated, Action <string> logInfo, Action <string> logError,
                               Func <object, string> serializeFunction, TaskScheduler loggingScheduler = null)
        {
            var advice = new LoggingAdvice <T>(decorated, logInfo, logError, serializeFunction, loggingScheduler);

            return((T)advice.GetTransparentProxy());
        }
Esempio n. 2
0
 public ICalculator CreateCalculator()
 {
     return(LoggingAdvice <ICalculator> .Create(
                new Calculator(),
                s => _logger.Log("Info:" + s),
                s => _logger.Log("Error:" + s),
                o => o?.ToString()));
 }