mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 12:07:05 +00:00
feature: JsonUtils.Print shim for serializing and printing a given object
This commit is contained in:
parent
861acc34c0
commit
14d83f102f
1 changed files with 11 additions and 1 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue