-Added ITraceWriter
-Fixed .NET 2.0 build using DateTimeOffset
This commit is contained in:
@@ -23,8 +23,11 @@
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
using Newtonsoft.Json.Utilities;
|
||||
|
||||
namespace Newtonsoft.Json
|
||||
{
|
||||
@@ -85,5 +88,28 @@ namespace Newtonsoft.Json
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
internal static string FormatMessage(IJsonLineInfo lineInfo, string path, string message)
|
||||
{
|
||||
// don't add a fullstop and space when message ends with a new line
|
||||
if (!message.EndsWith(Environment.NewLine))
|
||||
{
|
||||
message = message.Trim();
|
||||
|
||||
if (!message.EndsWith("."))
|
||||
message += ".";
|
||||
|
||||
message += " ";
|
||||
}
|
||||
|
||||
message += "Path '{0}'".FormatWith(CultureInfo.InvariantCulture, path);
|
||||
|
||||
if (lineInfo != null && lineInfo.HasLineInfo())
|
||||
message += ", line {0}, position {1}".FormatWith(CultureInfo.InvariantCulture, lineInfo.LineNumber, lineInfo.LinePosition);
|
||||
|
||||
message += ".";
|
||||
|
||||
return message;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user