Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
namespace NLog.LayoutRenderers.Wrappers
{
using System;
using System.ComponentModel;
using System.Text;
using NLog.Config;

Expand Down Expand Up @@ -70,6 +71,7 @@ public sealed class JsonEncodeLayoutRendererWrapper : WrapperLayoutRendererBase
/// </remarks>
/// <docgen category="Layout Options" order="10"/>
[Obsolete("Marked obsolete with NLog 5.5. Should never escape forward slash")]
[EditorBrowsable(EditorBrowsableState.Never)]
public bool EscapeForwardSlash { get; set; }

/// <inheritdoc/>
Expand Down
4 changes: 3 additions & 1 deletion 4 src/NLog/Layouts/JSON/JsonAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
namespace NLog.Layouts
{
using System;
using System.ComponentModel;
using System.Text;
using NLog.Config;

Expand Down Expand Up @@ -133,7 +134,8 @@ public string Name
/// If not set explicitly then the value of the parent will be used as default.
/// </remarks>
/// <docgen category='Layout Options' order='100' />
[Obsolete("Marked obsolete with NLog 5.5. Should never escape forward slash")]
[Obsolete("Marked obsolete since forward slash are valid JSON. Marked obsolete with NLog v5.4")]
[EditorBrowsable(EditorBrowsableState.Never)]
public bool EscapeForwardSlash { get; set; }

/// <summary>
Expand Down
1 change: 1 addition & 0 deletions 1 src/NLog/Layouts/JSON/JsonLayout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ public bool IndentJson
/// </remarks>
/// <docgen category='Layout Options' order='100' />
[Obsolete("Marked obsolete with NLog 5.5. Should never escape forward slash")]
[EditorBrowsable(EditorBrowsableState.Never)]
public bool EscapeForwardSlash { get; set; }

/// <inheritdoc/>
Expand Down
3 changes: 2 additions & 1 deletion 3 src/NLog/Targets/DefaultJsonSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,10 @@ public string SerializeObject(object value, JsonSerializeOptions options)
}
else if (value is string str)
{
var escapeUnicode = options.EscapeUnicode;
foreach (var chr in str)
{
if (RequiresJsonEscape(chr, options.EscapeUnicode))
if (RequiresJsonEscape(chr, escapeUnicode))
{
StringBuilder sb = new StringBuilder(str.Length + 4);
sb.Append('"');
Expand Down
1 change: 1 addition & 0 deletions 1 src/NLog/Targets/JsonSerializeOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public class JsonSerializeOptions
/// Should forward slashes be escaped? If true, / will be converted to \/
/// </summary>
[Obsolete("Marked obsolete with NLog 5.5. Should never escape forward slash")]
[EditorBrowsable(EditorBrowsableState.Never)]
public bool EscapeForwardSlash { get; set; }

/// <summary>
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.