ToString() public method

public ToString ( ) : string
return string
示例#1
0
 protected override void OnEventWritten(EventWrittenEventArgs eventData)
 {
     foreach (object pl in eventData.Payload)
     {
         if (pl is IDictionary <string, object> dict)
         {
             var rex = new RabbitMqExceptionDetail(dict);
             Console.WriteLine("{0}: {1}", eventData.Level, rex.ToString());
         }
         else
         {
             Console.WriteLine("{0}: {1}", eventData.Level, pl.ToString());
         }
     }
 }
 protected override void OnEventWritten(EventWrittenEventArgs eventData)
 {
     foreach(var pl in eventData.Payload)
     {
         var dict = pl as IDictionary<string, object>;
         if(dict != null)
         {
             var rex = new RabbitMqExceptionDetail(dict);
             Console.WriteLine("{0}: {1}", eventData.Level, rex.ToString());
         }
         else
         {
             Console.WriteLine("{0}: {1}", eventData.Level, pl.ToString());
         }
     }
 }