feature: JsonUtils.Print shim for serializing and printing a given object

This commit is contained in:
Chris Cameron
2018-04-05 15:09:33 -04:00
parent 861acc34c0
commit 14d83f102f

View File

@@ -1,5 +1,4 @@
using System;
using System.Globalization;
using System.Linq;
using System.Text;
using ICD.Common.Properties;
@@ -94,6 +93,17 @@ namespace ICD.Common.Utils.Json
IcdConsole.PrintLine(Format(json));
}
/// <summary>
/// Serializes the given item and pretty-prints to JSON.
/// </summary>
/// <param name="value"></param>
[PublicAPI]
public static void Print(object value)
{
string serial = JsonConvert.SerializeObject(value);
Print(serial);
}
/// <summary>
/// Formats the JSON into a human-readable form.
/// </summary>