mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 21:24:58 +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;
|
||||||
using System.Globalization;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using ICD.Common.Properties;
|
using ICD.Common.Properties;
|
||||||
@@ -94,6 +93,17 @@ namespace ICD.Common.Utils.Json
|
|||||||
IcdConsole.PrintLine(Format(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>
|
/// <summary>
|
||||||
/// Formats the JSON into a human-readable form.
|
/// Formats the JSON into a human-readable form.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user