diff --git a/Client.cs b/Client.cs index 5d6bcde..40e25d9 100644 --- a/Client.cs +++ b/Client.cs @@ -14,6 +14,9 @@ using System.Threading.Tasks; using TL; using static WTelegram.Encryption; +//TODO: include XML comments in nuget +//TODO: make assembly versions match nuget package version + namespace WTelegram { public sealed class Client : IDisposable @@ -150,7 +153,7 @@ namespace WTelegram } else { - Helpers.Log(1, $"Sending {msg.GetType().Name}... (seqno {seqno})"); + Helpers.Log(1, $"Sending {msg.GetType().Name,-50} #{(short)msgId.GetHashCode():X4})"); //TODO: Implement MTProto 2.0 using var clearStream = new MemoryStream(1024); //TODO: choose a useful capacity using var clearWriter = new BinaryWriter(clearStream, Encoding.UTF8); @@ -302,6 +305,7 @@ namespace WTelegram rpcResult.result = Schema.DeserializeValue(reader, _lastRpcResultType); else rpcResult.result = Schema.Deserialize(reader); + Helpers.Log(1, $" → {rpcResult.result.GetType().Name,-50} #{(short)reqMsgId.GetHashCode():X4})"); return rpcResult; } diff --git a/Helpers.cs b/Helpers.cs index 8b1888b..95308e5 100644 --- a/Helpers.cs +++ b/Helpers.cs @@ -5,7 +5,7 @@ namespace WTelegram { public static class Helpers { - public static readonly System.Text.Json.JsonSerializerOptions JsonOptions = new(System.Text.Json.JsonSerializerDefaults.Web) { IncludeFields = true }; + public static readonly System.Text.Json.JsonSerializerOptions JsonOptions = new(System.Text.Json.JsonSerializerDefaults.Web) { IncludeFields = true, WriteIndented = true }; public static V GetOrCreate(this Dictionary dictionary, K key) where V : new() => dictionary.TryGetValue(key, out V value) ? value : dictionary[key] = new V();