aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Helpers/Log.cs
blob: ac231810cc9adf48eb92d1efa905b7c052dc07d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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();
        }
    }
}