summaryrefslogtreecommitdiff
path: root/docs/Classes/SDLLogFileModule.html
blob: 055d88b4d203a056427c57219c17da4a94b69897 (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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
<h1>SDLLogFileModule Class Reference</h1>

<h3>Section Contents</h3>

<ul>
  <li><a href="#section-name">name</a></li>
  <li><a href="#section-files">files</a></li>
  <li><a href="#section-logLevel">logLevel</a></li>
  <li><a href="#section--init">-init</a></li>
  <li><a href="#section--initWithName:files:level:">-initWithName:files:level:</a></li>
  <li><a href="#section--initWithName:files:">-initWithName:files:</a></li>
  <li><a href="#section-+moduleWithName:files:">+moduleWithName:files:</a></li>
  <li><a href="#section--containsFile:">-containsFile:</a></li>
</ul>

<h3>Overview</h3>

<p>Undocumented</p>


<section class="section task-group-section">
  <h3 id="section-name">
      name
  </h3>
  
  <p>The name of the this module, e.g. <q>Transport</q></p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight objective_c"><code><span class="k">@property</span> <span class="p">(</span><span class="n">readonly</span><span class="p">,</span> <span class="n">copy</span><span class="p">,</span> <span class="n">nonatomic</span><span class="p">)</span> <span class="n">NSString</span> <span class="o">*</span><span class="n">_Nonnull</span> <span class="n">name</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight swift"><code><span class="k">var</span> <span class="nv">name</span><span class="p">:</span> <span class="nf">String</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

  
  
  
  <h3 id="section-files">
      files
  </h3>
  
  <p>All of the files contained within this module. When a log is logged, the <code>__FILE__</code> (in Obj-C) or <code>#file</code> (in Swift) is automatically captured and checked to see if any module has a file in this set that matches. If it does, it will be logged using the module&rsquo;s log level and the module&rsquo;s name will be printed in the formatted log.</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight objective_c"><code><span class="k">@property</span> <span class="p">(</span><span class="n">readonly</span><span class="p">,</span> <span class="n">copy</span><span class="p">,</span> <span class="n">nonatomic</span><span class="p">)</span> <span class="n">NSSet</span><span class="o">&lt;</span><span class="n">NSString</span> <span class="o">*&gt;</span> <span class="o">*</span><span class="n">_Nonnull</span> <span class="n">files</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight swift"><code><span class="k">var</span> <span class="nv">files</span><span class="p">:</span> <span class="kt">Set</span><span class="o">&lt;</span><span class="kt">String</span><span class="o">&gt;</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

  
  
  
  <h3 id="section-logLevel">
      logLevel
  </h3>
  
  <p>The custom level of the log. This is <code>SDLLogLevelDefault</code> (whatever the current global log level is) by default.</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight objective_c"><code><span class="k">@property</span> <span class="p">(</span><span class="n">assign</span><span class="p">,</span> <span class="n">readwrite</span><span class="p">,</span> <span class="n">nonatomic</span><span class="p">)</span> <span class="n"><a href="../Enums/SDLLogLevel.html">SDLLogLevel</a></span> <span class="n">logLevel</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight swift"><code><span class="k">var</span> <span class="nv">logLevel</span><span class="p">:</span> <span class="nf">SDLLogLevel</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>

  
  
  
  <h3 id="section--init">
      -init
  </h3>
  
  <p>This method is unavailable and may not be used.</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">instancetype</span><span class="p">)</span><span class="n">init</span><span class="p">;</span></code></pre>

  
  
  
  <div>
    <h4>Return Value</h4>
    <p>Always returns nil</p>
  </div>
  
  <h3 id="section--initWithName:files:level:">
      -initWithName:files:level:
  </h3>
  
  <p>Returns an initialized <code>SDLLogFileModule</code> that contains a custom name, set of files, and associated log level.</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">instancetype</span><span class="p">)</span><span class="nf">initWithName</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">name</span>
                               <span class="nf">files</span><span class="p">:(</span><span class="n">nonnull</span> <span class="n">NSSet</span><span class="o">&lt;</span><span class="n">NSString</span> <span class="o">*&gt;</span> <span class="o">*</span><span class="p">)</span><span class="nv">files</span>
                               <span class="nf">level</span><span class="p">:(</span><span class="n"><a href="../Enums/SDLLogLevel.html">SDLLogLevel</a></span><span class="p">)</span><span class="nv">level</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight swift"><code><span class="nf">init</span><span class="p">(</span><span class="nv">name</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">files</span><span class="p">:</span> <span class="kt">Set</span><span class="o">&lt;</span><span class="kt">String</span><span class="o">&gt;</span><span class="p">,</span> <span class="nv">level</span><span class="p">:</span> <span class="kt"><a href="../Enums/SDLLogLevel.html">SDLLogLevel</a></span><span class="p">)</span></code></pre>

  
  
  <h4>Parameters</h4>
  <dl>
      <dt>name</dt>
      <dd><p>The name of this module. This will be used when printing a formatted log for a file within this module e.g. <q>Transport</q>.</p></dd>
      <dt>files</dt>
      <dd><p>The files this module covers. This should correspond to a <code>__FILE__</code> or <code>#file</code> call for use when comparing a log to this module. Any log originating in a file contained in this set will then use this module&rsquo;s log level and print the module name.</p></dd>
      <dt>level</dt>
      <dd><p>The custom logging level logs originating in files contained in this log module will use. For example, if the global level is <code>SDLLogLevelError</code> and this module is configured to <code>SDLLogLevelVerbose</code>, all logs originating from files within this module will be logged, not merely error logs.</p></dd>
  </dl>
  <div>
    <h4>Return Value</h4>
    <p>An initialized <code>SDLLogFileModule</code></p>
  </div>
  
  <h3 id="section--initWithName:files:">
      -initWithName:files:
  </h3>
  
  <p>Returns an initialized <code>SDLLogFileModule</code> that contains a custom name and set of files. The logging level is the same as the current global logging file by using <code>SDLLogLevelDefault</code>.</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">instancetype</span><span class="p">)</span><span class="nf">initWithName</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">name</span>
                               <span class="nf">files</span><span class="p">:(</span><span class="n">nonnull</span> <span class="n">NSSet</span><span class="o">&lt;</span><span class="n">NSString</span> <span class="o">*&gt;</span> <span class="o">*</span><span class="p">)</span><span class="nv">files</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight swift"><code><span class="n">convenience</span> <span class="nf">init</span><span class="p">(</span><span class="nv">name</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">files</span><span class="p">:</span> <span class="kt">Set</span><span class="o">&lt;</span><span class="kt">String</span><span class="o">&gt;</span><span class="p">)</span></code></pre>

  
  
  <h4>Parameters</h4>
  <dl>
      <dt>name</dt>
      <dd><p>The name of this module. This will be used when printing a formatted log for a file within this module e.g. <q>Transport</q>.</p></dd>
      <dt>files</dt>
      <dd><p>The files this module covers. This should correspond to a <code>__FILE__</code> or <code>#file</code> call for use when comparing a log to this module. Any log originating in a file contained in this set will then use this module&rsquo;s log level and print the module name.</p></dd>
  </dl>
  <div>
    <h4>Return Value</h4>
    <p>An initialized <code>SDLLogFileModule</code></p>
  </div>
  
  <h3 id="section-+moduleWithName:files:">
      +moduleWithName:files:
  </h3>
  
  <p>Returns an initialized <code>SDLLogFileModule</code> that contains a custom name and set of files. The logging level is the same as the current global logging file by using <code>SDLLogLevelDefault</code>.</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">instancetype</span><span class="p">)</span><span class="nf">moduleWithName</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">name</span>
                                 <span class="nf">files</span><span class="p">:(</span><span class="n">nonnull</span> <span class="n">NSSet</span><span class="o">&lt;</span><span class="n">NSString</span> <span class="o">*&gt;</span> <span class="o">*</span><span class="p">)</span><span class="nv">files</span><span class="p">;</span></code></pre>

  
  
  
  <h4>Parameters</h4>
  <dl>
      <dt>name</dt>
      <dd><p>The name of this module. This will be used when printing a formatted log for a file within this module e.g. <q>Transport</q>.</p></dd>
      <dt>files</dt>
      <dd><p>The files this module covers. This should correspond to a <code>__FILE__</code> or <code>#file</code> call for use when comparing a log to this module. Any log originating in a file contained in this set will then use this module&rsquo;s log level and print the module name.</p></dd>
  </dl>
  <div>
    <h4>Return Value</h4>
    <p>An initialized <code>SDLLogFileModule</code></p>
  </div>
  
  <h3 id="section--containsFile:">
      -containsFile:
  </h3>
  
  <p>Returns whether or not this module contains a given file.</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="nf">containsFile</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">fileName</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">containsFile</span><span class="p">(</span><span class="n">_</span> <span class="nv">fileName</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>

  
  
  <h4>Parameters</h4>
  <dl>
      <dt>fileName</dt>
      <dd><p>The file name to check</p></dd>
  </dl>
  <div>
    <h4>Return Value</h4>
    <p>A BOOL, YES if this module contains the given file.</p>
  </div>
  
</section>