summaryrefslogtreecommitdiff
path: root/docs/Protocols/SDLLogTarget.html
blob: 931f88ebcfbb25c00884d26307c726d82f5bf925 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<h1>SDLLogTarget Protocol Reference</h1>

<h3>Section Contents</h3>

<ul>
  <li><a href="#section-+logger">+logger</a></li>
  <li><a href="#section--setupLogger">-setupLogger</a></li>
  <li><a href="#section--logWithLog:formattedLog:">-logWithLog:formattedLog:</a></li>
  <li><a href="#section--teardownLogger">-teardownLogger</a></li>
</ul>

<h3>Overview</h3>

<p>A protocol describing a place logs from SDLLogManager are logged to</p>


<section class="section task-group-section">
  <h3 id="section-+logger">
      +logger
  </h3>
  
  <p>A simple convenience initializer to create the object. This <em>should not</em> start up the logger.</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight objective_c"><code><span class="k">+</span> <span class="p">(</span><span class="n">nonnull</span> <span class="n">id</span><span class="o">&lt;</span><span class="n">SDLLogTarget</span><span class="o">&gt;</span><span class="p">)</span><span class="n">logger</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">logger</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">SDLLogTarget</span></code></pre>

  
  
  <div>
    <h4>Return Value</h4>
    <p>An instance of the logger.</p>
  </div>
  
  <h3 id="section--setupLogger">
      -setupLogger
  </h3>
  
  <p>A call to setup the logger in whatever manner it needs to do so.</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight objective_c"><code><span class="k">-</span> <span class="p">(</span><span class="n">BOOL</span><span class="p">)</span><span class="n">setupLogger</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">setupLogger</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>

  
  
  <div>
    <h4>Return Value</h4>
    <p>Whether or not the logger set up correctly.</p>
  </div>
  
  <h3 id="section--logWithLog:formattedLog:">
      -logWithLog:formattedLog:
  </h3>
  
  <p>Log a particular log using the model and the formatted log message to the target.</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight objective_c"><code><span class="k">-</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span><span class="nf">logWithLog</span><span class="p">:(</span><span class="n">nonnull</span> <span class="n">SDLLogModel</span> <span class="o">*</span><span class="p">)</span><span class="nv">log</span>
      <span class="nf">formattedLog</span><span class="p">:(</span><span class="n">nonnull</span> <span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="nv">stringLog</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">log</span><span class="p">(</span><span class="n">withLog</span> <span class="nv">log</span><span class="p">:</span> <span class="kt">SDLLogModel</span><span class="p">,</span> <span class="n">formattedLog</span> <span class="nv">stringLog</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>

  
  
  <h4>Parameters</h4>
  <dl>
      <dt>log</dt>
      <dd><p>The log model, if you can log additional data, such as the log level, use this</p></dd>
      <dt>stringLog</dt>
      <dd><p>The formatted message</p></dd>
  </dl>
  
  <h3 id="section--teardownLogger">
      -teardownLogger
  </h3>
  
  <p>The log target should be torn down. e.g. file handles should be closed</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight objective_c"><code><span class="k">-</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span><span class="n">teardownLogger</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">teardownLogger</span><span class="p">()</span></code></pre>

  
  
  
</section>