~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to external/Newtonsoft.Json/Doc/SerializationTracing.aml

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
Import upstream version 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="utf-8"?>
 
2
<topic id="SerializationTracing" revisionNumber="1">
 
3
  <developerConceptualDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">
 
4
    <introduction>
 
5
      <para>The Json.NET serializer supports logging and debugging using the
 
6
      <codeEntityReference>T:Newtonsoft.Json.Serialization.ITraceWriter</codeEntityReference> interface.
 
7
      By assigning a trace writer you can capture serialization messages and errors, and debug what happens inside the
 
8
      Json.NET serializer when serializing and deserializing JSON.</para>
 
9
    </introduction>
 
10
    <section>
 
11
      <title>ITraceWriter</title>
 
12
      <content>
 
13
        <para>A trace writer can be assigned using properties on JsonSerializerSettings or JsonSerializer.</para>
 
14
 
 
15
<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\TraceWriterTests.cs" region="MemoryTraceWriterExample" title="Debugging serialization using MemoryTraceWriter" />
 
16
        
 
17
        <para>Json.NET has two implementations of ITraceWriter: <codeEntityReference>T:Newtonsoft.Json.Serialization.MemoryTraceWriter</codeEntityReference>
 
18
        which keeps messages in memory for simple debugging like the example
 
19
        above, and <codeEntityReference>T:Newtonsoft.Json.Serialization.DiagnosticsTraceWriter</codeEntityReference> which writes messages to any
 
20
        System.Diagnostics.TraceListeners your application is using.</para>
 
21
      </content>
 
22
    </section>
 
23
    <section>
 
24
      <title>Custom ITraceWriter</title>
 
25
      <content>
 
26
        <para>To write messages using your existing logging framework just implement a custom version of ITraceWriter.</para>
 
27
 
 
28
<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\TraceWriterTests.cs" region="CustomTraceWriterExample" title="Custom NLog TraceWriter" />
 
29
        
 
30
      </content>
 
31
    </section>
 
32
    <relatedTopics>
 
33
      <codeEntityReference>T:Newtonsoft.Json.JsonSerializer</codeEntityReference>
 
34
      <codeEntityReference>T:Newtonsoft.Json.Serialization.ITraceWriter</codeEntityReference>
 
35
      <codeEntityReference>T:Newtonsoft.Json.Serialization.MemoryTraceWriter</codeEntityReference>
 
36
      <codeEntityReference>T:Newtonsoft.Json.Serialization.DiagnosticsTraceWriter</codeEntityReference>
 
37
    </relatedTopics>
 
38
  </developerConceptualDocument>
 
39
</topic>
 
 
b'\\ No newline at end of file'