Frank van den Bos 2 лет назад
Родитель
Сommit
af108fbca7

+ 1 - 0
InABox.Client.RPC/RPCClient.cs

@@ -131,6 +131,7 @@ namespace InABox.Rpc
                 {
                     new RpcQueryDefinition()
                     {
+                        Key = typeof(TEntity).EntityName().Split('.').Last(),
                         Type = typeof(TEntity),
                         Filter = filter,
                         Columns = columns,

+ 2 - 2
InABox.RPC.Shared/Commands/Query/RpcQueryDefinition.cs

@@ -31,8 +31,8 @@ namespace InABox.Rpc
             Sort = reader.ReadBinaryValue(typeof(SortOrder<>).MakeGenericType(Type)) as ISortOrder;
         }
 
-        public string FullDescription() => $"Query{Type.Name}: Filter=[{Filter}] Sort=[{Sort}]";
+        public string FullDescription() => $"[{Filter}]";
 
-        public string ShortDescription() => $"Query{Type.Name}";
+        public string ShortDescription() => $"Query";
     }
 }

+ 3 - 2
InABox.RPC.Shared/Commands/Query/RpcQueryParameters.cs

@@ -1,3 +1,4 @@
+using System.Linq;
 using InABox.Core;
 
 namespace InABox.Rpc
@@ -18,8 +19,8 @@ namespace InABox.Rpc
             Queries = reader.ReadBinaryValue<RpcQueryDefinition[]>();
         }
 
-        public string FullDescription() => $"Query({Queries.Length})";
+        public string FullDescription() => $"{string.Join(", ", Queries.Select(x=>$"{x.Key}={x.FullDescription()}"))}";
 
-        public string ShortDescription() => $"Query({Queries.Length})";
+        public string ShortDescription() => $"Query";
     }
 }

+ 5 - 2
InABox.RPC.Shared/Commands/Query/RpcQueryResult.cs

@@ -1,4 +1,6 @@
+using System.Linq;
 using InABox.Core;
+using Inflector;
 
 namespace InABox.Rpc
 {
@@ -14,8 +16,9 @@ namespace InABox.Rpc
         public void DeserializeBinary(CoreBinaryReader reader)
         {
             Tables = reader.ReadBinaryValue<RpcQueryTable[]>();
+            
         }
-
-        public string FullDescription() => $"Query({Tables.Length})";
+        
+        public string FullDescription() => $"{string.Join(", ", Tables.Select(x => $"{x.Key}=({x.Table.Rows.Count} Rows / {x.Table.Columns.Count} Columns)"))}";
     }
 }

+ 3 - 2
InABox.Server/RPC/Handlers/RPCCommandHandler.cs

@@ -28,7 +28,7 @@ namespace InABox.Rpc
             var start = DateTime.Now;
             var parameters = Serialization.ReadBinary<TParameters>(payload, BinarySerializationSettings.Latest);
             if (IsLogCommand)
-                Logger.Send(LogType.Information, session.UserID, $"[{session.Platform} {session.Version}] {parameters.FullDescription()}");
+                Logger.Send(LogType.Information, session.UserID, $"[{session.Platform} {session.Version}] {parameters.ShortDescription()} {parameters.FullDescription()}");
             
             try
             {
@@ -39,7 +39,8 @@ namespace InABox.Rpc
                     var description = result.FullDescription();
                     Logger.Send(LogType.Information, session.UserID, string.Format("[{0} {1}] [{2:D8}] {3} Complete{4}",
                         session.Platform, session.Version,
-                        (int)DateTime.Now.Subtract(start).TotalMilliseconds, parameters.ShortDescription(),
+                        (int)DateTime.Now.Subtract(start).TotalMilliseconds, 
+                        parameters.ShortDescription(),
                         string.IsNullOrWhiteSpace(description) ? "" : $" {description}"));
                 }