aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Helpers
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2019-08-04 23:26:23 +0800
committer杨宇千 <crupest@outlook.com>2019-08-04 23:26:23 +0800
commit4c92aa04f9eff2aa80d804fb1d347dbc04bf2998 (patch)
tree9016b0017634a7589981a38629f9b27ad76fb9ee /Timeline/Helpers
parent52f5d2724d74ddb37141d8dfcc8384c0c8ce0e24 (diff)
downloadtimeline-4c92aa04f9eff2aa80d804fb1d347dbc04bf2998.tar.gz
timeline-4c92aa04f9eff2aa80d804fb1d347dbc04bf2998.tar.bz2
timeline-4c92aa04f9eff2aa80d804fb1d347dbc04bf2998.zip
Improve log.
Diffstat (limited to 'Timeline/Helpers')
-rw-r--r--Timeline/Helpers/Log.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/Timeline/Helpers/Log.cs b/Timeline/Helpers/Log.cs
new file mode 100644
index 00000000..ac231810
--- /dev/null
+++ b/Timeline/Helpers/Log.cs
@@ -0,0 +1,24 @@
+using System.Collections.Generic;
+using System.Text;
+
+namespace Timeline.Helpers
+{
+ public static class MyLogHelper
+ {
+ public static KeyValuePair<string, object> Pair(string key, object value) => new KeyValuePair<string, object>(key, value);
+
+ public static string FormatLogMessage(string summary, params KeyValuePair<string, object>[] properties)
+ {
+ var builder = new StringBuilder();
+ builder.Append(summary);
+ foreach (var property in properties)
+ {
+ builder.AppendLine();
+ builder.Append(property.Key);
+ builder.Append(" : ");
+ builder.Append(property.Value);
+ }
+ return builder.ToString();
+ }
+ }
+}