Esempio n. 1
0
 private static void DoLogging(IFakeObjectCall call, ISink sink, IMessageSource messageSource)
 {
     try
     {
         var msgCfg       = messageSource.GetMessageConfiguration(call.Method.Name);
         var formattedMsg = msgCfg.Text;
         var level        = msgCfg.Level;
         try
         {
             formattedMsg = string.Format(msgCfg.Text, call.Arguments.ToArray());
         }
         catch (Exception)
         {
             // do the needful
         }
         //IFormattable abs = $"123 {0}, {call.Arguments[0]}";
         sink.Write(formattedMsg, level);
     } catch (Exception e)
     {
         // ok, so one of the components failed.
         Trace.Write(e);
     }
 }