Exemplo n.º 1
0
        public LoggingEntry(Guid id, LoggingDeserializeContext context)
        {
            Id       = id;
            LogLevel = (LogLevel)context.br.ReadByte();
            EventId  = new EventId(context.br.ReadInt32(), context.br.ReadNullableString());
            Message  = context.br.ReadNullableString();

            if (context.br.ReadBoolean())
            {
                Exception = new LoggingException(context);
            }

            if (context.br.ReadBoolean())
            {
                var count = context.br.ReadInt32();
                var list  = new List <KeyValuePair <string, string?> >(count);
                for (var i = 0; i < count; i++)
                {
                    var key   = context.br.ReadString();
                    var value = context.br.ReadNullableString();
                    list.Add(new KeyValuePair <string, string?>(key, value));
                }
                Data = list;
            }
        }
Exemplo n.º 2
0
 public LoggingEntry(Guid id, Exception?exception)
 {
     Id = id;
     if (exception != default)
     {
         Exception = new LoggingException(exception);
     }
 }