mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-08 17:24:49 +00:00
feature: JsonUtils.Print shim for serializing and printing a given object
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user