-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgettingstarted.html
532 lines (476 loc) · 25.6 KB
/
gettingstarted.html
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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
<!DOCTYPE html>
<html lang="en">
<head>
<title>GettingStarted Reference</title>
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
<meta charset='utf-8'>
<script src="js/jquery.min.js" defer></script>
<script src="js/jazzy.js" defer></script>
<script src="js/lunr.min.js" defer></script>
<script src="js/typeahead.jquery.js" defer></script>
<script src="js/jazzy.search.js" defer></script>
</head>
<body>
<a title="GettingStarted Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="index.html">CocoaLumberjack 3.7.0 Docs</a> (64% documented)</p>
<p class="header-right"><a href="https://github.com/CocoaLumberjack/CocoaLumberjack"><img src="img/gh.png"/>View on GitHub</a></p>
<p class="header-right">
<form role="search" action="search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="index.html">CocoaLumberjack Reference</a>
<img id="carat" src="img/carat.png" />
GettingStarted Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="Guides.html">Guides</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="arc.html">ARC</a>
</li>
<li class="nav-group-task">
<a href="appcode-support.html">AppCode-support</a>
</li>
<li class="nav-group-task">
<a href="architecture.html">Architecture</a>
</li>
<li class="nav-group-task">
<a href="combineloggers.html">CombineLoggers</a>
</li>
<li class="nav-group-task">
<a href="customcontext.html">CustomContext</a>
</li>
<li class="nav-group-task">
<a href="customformatters.html">CustomFormatters</a>
</li>
<li class="nav-group-task">
<a href="customloglevels.html">CustomLogLevels</a>
</li>
<li class="nav-group-task">
<a href="customloggers.html">CustomLoggers</a>
</li>
<li class="nav-group-task">
<a href="dynamicloglevels.html">DynamicLogLevels</a>
</li>
<li class="nav-group-task">
<a href="faq.html">FAQ</a>
</li>
<li class="nav-group-task">
<a href="finegrainedlogging.html">FineGrainedLogging</a>
</li>
<li class="nav-group-task">
<a href="gettingstarted.html">GettingStarted</a>
</li>
<li class="nav-group-task">
<a href="logfilemanagement.html">LogFileManagement</a>
</li>
<li class="nav-group-task">
<a href="perloggerloglevels.html">PerLoggerLogLevels</a>
</li>
<li class="nav-group-task">
<a href="peruserloglevels.html">PerUserLogLevels</a>
</li>
<li class="nav-group-task">
<a href="performance.html">Performance</a>
</li>
<li class="nav-group-task">
<a href="problemsolution.html">ProblemSolution</a>
</li>
<li class="nav-group-task">
<a href="readme.html">README</a>
</li>
<li class="nav-group-task">
<a href="xcodecolors.html">XcodeColors</a>
</li>
<li class="nav-group-task">
<a href="xcodetricks.html">XcodeTricks</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Classes/CLIColor.html">CLIColor</a>
</li>
<li class="nav-group-task">
<a href="Classes/DDASLLogCapture.html">DDASLLogCapture</a>
</li>
<li class="nav-group-task">
<a href="Classes/DDASLLogger.html">DDASLLogger</a>
</li>
<li class="nav-group-task">
<a href="Classes/DDAbstractDatabaseLogger.html">DDAbstractDatabaseLogger</a>
</li>
<li class="nav-group-task">
<a href="Classes/DDAbstractLogger.html">DDAbstractLogger</a>
</li>
<li class="nav-group-task">
<a href="Classes.html#/c:objc(cs)DDAtomicCounter">DDAtomicCounter</a>
</li>
<li class="nav-group-task">
<a href="Classes/DDContextBlacklistFilterLogFormatter.html">DDContextBlacklistFilterLogFormatter</a>
</li>
<li class="nav-group-task">
<a href="Classes/DDContextWhitelistFilterLogFormatter.html">DDContextWhitelistFilterLogFormatter</a>
</li>
<li class="nav-group-task">
<a href="Classes/DDDispatchQueueLogFormatter.html">DDDispatchQueueLogFormatter</a>
</li>
<li class="nav-group-task">
<a href="Classes/DDFileLogger.html">DDFileLogger</a>
</li>
<li class="nav-group-task">
<a href="Classes/DDLog.html">DDLog</a>
</li>
<li class="nav-group-task">
<a href="Classes/DDLogFileFormatterDefault.html">DDLogFileFormatterDefault</a>
</li>
<li class="nav-group-task">
<a href="Classes/DDLogFileInfo.html">DDLogFileInfo</a>
</li>
<li class="nav-group-task">
<a href="Classes/DDLogFileManagerDefault.html">DDLogFileManagerDefault</a>
</li>
<li class="nav-group-task">
<a href="Classes/DDLogMessage.html">DDLogMessage</a>
</li>
<li class="nav-group-task">
<a href="Classes/DDLoggerInformation.html">DDLoggerInformation</a>
</li>
<li class="nav-group-task">
<a href="Classes/DDMultiFormatter.html">DDMultiFormatter</a>
</li>
<li class="nav-group-task">
<a href="Classes/DDOSLogger.html">DDOSLogger</a>
</li>
<li class="nav-group-task">
<a href="Classes/DDTTYLogger.html">DDTTYLogger</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Constants.html">Constants</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Constants.html#/c:@CocoaLumberjackVersionNumber">CocoaLumberjackVersionNumber</a>
</li>
<li class="nav-group-task">
<a href="Constants.html#/c:@CocoaLumberjackVersionString">CocoaLumberjackVersionString</a>
</li>
<li class="nav-group-task">
<a href="Constants.html#/c:@DDLoggerNameASL">DDLoggerNameASL</a>
</li>
<li class="nav-group-task">
<a href="Constants.html#/c:@DDLoggerNameFile">DDLoggerNameFile</a>
</li>
<li class="nav-group-task">
<a href="Constants.html#/c:@DDLoggerNameOS">DDLoggerNameOS</a>
</li>
<li class="nav-group-task">
<a href="Constants.html#/c:@DDLoggerNameTTY">DDLoggerNameTTY</a>
</li>
<li class="nav-group-task">
<a href="Constants.html#/c:@DDQualityOfServiceBackground">DDQualityOfServiceBackground</a>
</li>
<li class="nav-group-task">
<a href="Constants.html#/c:@DDQualityOfServiceDefault">DDQualityOfServiceDefault</a>
</li>
<li class="nav-group-task">
<a href="Constants.html#/c:@DDQualityOfServiceUnspecified">DDQualityOfServiceUnspecified</a>
</li>
<li class="nav-group-task">
<a href="Constants.html#/c:@DDQualityOfServiceUserInitiated">DDQualityOfServiceUserInitiated</a>
</li>
<li class="nav-group-task">
<a href="Constants.html#/c:@DDQualityOfServiceUserInteractive">DDQualityOfServiceUserInteractive</a>
</li>
<li class="nav-group-task">
<a href="Constants.html#/c:@DDQualityOfServiceUtility">DDQualityOfServiceUtility</a>
</li>
<li class="nav-group-task">
<a href="Constants.html#/c:@kDDASLDDLogValue">kDDASLDDLogValue</a>
</li>
<li class="nav-group-task">
<a href="Constants.html#/c:@kDDASLKeyDDLog">kDDASLKeyDDLog</a>
</li>
<li class="nav-group-task">
<a href="Constants.html#/c:@kDDDefaultLogFilesDiskQuota">kDDDefaultLogFilesDiskQuota</a>
</li>
<li class="nav-group-task">
<a href="Constants.html#/c:@kDDDefaultLogMaxFileSize">kDDDefaultLogMaxFileSize</a>
</li>
<li class="nav-group-task">
<a href="Constants.html#/c:@kDDDefaultLogMaxNumLogFiles">kDDDefaultLogMaxNumLogFiles</a>
</li>
<li class="nav-group-task">
<a href="Constants.html#/c:@kDDDefaultLogRollingFrequency">kDDDefaultLogRollingFrequency</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Enums.html">Enumerations</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Enums/DDDispatchQueueLogFormatterMode.html">DDDispatchQueueLogFormatterMode</a>
</li>
<li class="nav-group-task">
<a href="Enums/DDLogFlag.html">DDLogFlag</a>
</li>
<li class="nav-group-task">
<a href="Enums/DDLogLevel.html">DDLogLevel</a>
</li>
<li class="nav-group-task">
<a href="Enums/DDLogMessageOptions.html">DDLogMessageOptions</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Protocols/DDAtomicCountable.html">DDAtomicCountable</a>
</li>
<li class="nav-group-task">
<a href="Protocols/DDLogFileManager.html">DDLogFileManager</a>
</li>
<li class="nav-group-task">
<a href="Protocols/DDLogFormatter.html">DDLogFormatter</a>
</li>
<li class="nav-group-task">
<a href="Protocols/DDLogger.html">DDLogger</a>
</li>
<li class="nav-group-task">
<a href="Protocols/DDRegisteredDynamicLogging.html">DDRegisteredDynamicLogging</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Type%20Definitions.html">Type Definitions</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Type%20Definitions.html#/c:DDTTYLogger.h@T@DDColor">DDColor</a>
</li>
<li class="nav-group-task">
<a href="Type%20Definitions.html#/c:DDLoggerNames.h@T@DDLoggerName">DDLoggerName</a>
</li>
<li class="nav-group-task">
<a href="Type%20Definitions.html#/c:DDDispatchQueueLogFormatter.h@T@DDQualityOfServiceName">DDQualityOfServiceName</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Functions.html">Functions</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Functions.html#/c:@F@DDExtractFileNameWithoutExtension">DDExtractFileNameWithoutExtension</a>
</li>
<li class="nav-group-task">
<a href="Functions.html#/c:DDTTYLogger.h@F@DDMakeColor">DDMakeColor</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<p><em>Getting started with the CocoaLumberjack framework.</em></p>
<hr>
<p>There are 3 steps to getting started with the logging framework:</p>
<ol>
<li>Add the CocoaLumberjack files to your project</li>
<li>Access and configure the framework</li>
<li>Convert your NSLog statements to use the CocoaLumberjack macros</li>
</ol>
<h3 id='add-cocoalumberjack-to-your-project' class='heading'>Add CocoaLumberjack to your project</h3>
<h4 id='cocoapods' class='heading'>CocoaPods</h4>
<pre class="highlight ruby"><code> <span class="n">platform</span> <span class="ss">:ios</span><span class="p">,</span> <span class="s1">'10.0'</span>
<span class="n">pod</span> <span class="s1">'CocoaLumberjack'</span>
</code></pre>
<h4 id='carthage' class='heading'>Carthage</h4>
<ul>
<li>Cartfile
<code>
github "CocoaLumberjack/CocoaLumberjack"
</code></li>
</ul>
<h4 id='manual-installation' class='heading'>Manual installation</h4>
<p><em>Please note, installation via CocoaPods or Carthage is much simpler and recommended by the development team</em></p>
<ul>
<li>Add in the CocoaLumberjack files to your project using git submodules</li>
</ul>
<pre class="highlight plaintext"><code> git submodule add https://[email protected]/CocoaLumberjack/CocoaLumberjack.git
</code></pre>
<ul>
<li>Drag <code>CocoaLumberjack/Lumberjack.xcodeproj</code> into your project</li>
<li>In your application target Build Phases
<ul>
<li>Add the framework you need
<ul>
<li><code>CocoaLumberjack</code> or <code>CocoaLumberjackSwift</code></li>
</ul></li>
</ul></li>
<li>Make this CocoaLumberjack framework a dependency for your application target</li>
<li>Add a Copy Files phase to the application bundle
<ul>
<li>This needs to specify the <em>Frameworks</em> sub-folder</li>
<li>Drag in the CocoaLumberjack.framework from the Lumberjack.xcodeproj products group</li>
<li><em>Note: be careful to include only your relevant platform product</em></li>
</ul></li>
</ul>
<h4 id='manual-installation-ios-static-library' class='heading'>Manual installation (iOS static library)</h4>
<p>Consider this method if you favour static libraries over frameworks or have to use the static library.</p>
<ul>
<li>Add in the CocoaLumberjack files to your project using git submodules</li>
</ul>
<pre class="highlight plaintext"><code> git submodule add https://[email protected]/CocoaLumberjack/CocoaLumberjack.git
</code></pre>
<ul>
<li>Drag <code>CocoaLumberjack/Lumberjack.xcodeproj</code> into your project</li>
<li>Make the <code>CocoaLumberjack-Static</code> a dependency for your application target</li>
<li>Add the <code>libCocoaLumberjack.a</code> to the <code>Link Binary</code> phase</li>
<li>Add <code>"$(BUILT_PRODUCTS_DIR)/include"</code> to the <code>Header Search Paths</code></li>
</ul>
<h4 id='even-more-manual-installation' class='heading'>Even more manual installation</h4>
<p>Consider this method if you want to more easily modify target build settings, have other complex needs or simply prefer to do things by hand.</p>
<ul>
<li>Download the CocoaLumberjack files using git clone</li>
</ul>
<pre class="highlight plaintext"><code> git clone https://[email protected]/CocoaLumberjack/CocoaLumberjack.git
</code></pre>
<ul>
<li>Copy just the .m/.h files from CocoaLumberjack/Classes into your project
<ul>
<li>Including the .swift file if relevant</li>
<li>Ignore the contents of the CLI and Extensions folders for basic use</li>
</ul></li>
<li>Add a separate CocoaLumberjack static library target
<ul>
<li>This will build e.g. a libCocoaLumberjack.a static library</li>
</ul></li>
<li>From time-to-time, git pull, re-copy and commit the updated CocoaLumberjack files</li>
</ul>
<h3 id='access-and-configure-the-framework' class='heading'>Access and configure the framework</h3>
<ul>
<li>Access the CocoaLumberjack framework by adding the following lines to a precompiled header (.pch) file
<ul>
<li><em>Note: newer Xcode projects do not create a .pch file by default but using one eases access to CocoaLumberjack through your project</em></li>
<li><em>Note: #defining LOG_LEVEL_DEF before #importing the framework is currently required, but has been under discussion in the early 2.x series</em></li>
</ul></li>
</ul>
<pre class="highlight objective_c"><code><span class="cp">#define LOG_LEVEL_DEF ddLogLevel
#import <CocoaLumberjack/CocoaLumberjack.h>
</span></code></pre>
<ul>
<li>Configure CocoaLumberjack (typically in the applicationDidFinishLaunching method)</li>
</ul>
<p>A couple lines of code is all you need to get started:</p>
<pre class="highlight objective_c"><code><span class="p">[</span><span class="n">DDLog</span> <span class="nf">addLogger</span><span class="p">:[</span><span class="n">DDOSLogger</span> <span class="nf">sharedInstance</span><span class="p">]];</span>
</code></pre>
<p>This will add a pair of “loggers” to the logging framework. In other words, your log statements will be sent to the Console.app and the Xcode console (just like a normal NSLog).</p>
<p>Part of the power of the logging framework is its flexibility. If you also wanted your log statements to be written to a file, then you could add and configure a file logger:</p>
<pre class="highlight objective_c"><code><span class="n">DDFileLogger</span> <span class="o">*</span><span class="n">fileLogger</span> <span class="o">=</span> <span class="p">[[</span><span class="n">DDFileLogger</span> <span class="nf">alloc</span><span class="p">]</span> <span class="nf">init</span><span class="p">];</span>
<span class="n">fileLogger</span><span class="p">.</span><span class="n">rollingFrequency</span> <span class="o">=</span> <span class="mi">60</span> <span class="o">*</span> <span class="mi">60</span> <span class="o">*</span> <span class="mi">24</span><span class="p">;</span> <span class="c1">// 24 hour rolling
</span><span class="n">fileLogger</span><span class="p">.</span><span class="n">logFileManager</span><span class="p">.</span><span class="n">maximumNumberOfLogFiles</span> <span class="o">=</span> <span class="mi">7</span><span class="p">;</span>
<span class="p">[</span><span class="n">DDLog</span> <span class="nf">addLogger</span><span class="p">:</span><span class="n">fileLogger</span><span class="p">];</span>
</code></pre>
<p>The above code tells the application to keep a week’s worth of log files on the system.</p>
<p>You will also need to set a global log level for your application. This can be modified in different manners later (see the bottom of this document for more information).</p>
<p>To do this, simply define the <code>ddLogLevel</code> constant. One example of this may be in your .pch file like so:</p>
<pre class="highlight objective_c"><code><span class="k">static</span> <span class="k">const</span> <span class="n">DDLogLevel</span> <span class="n">ddLogLevel</span> <span class="o">=</span> <span class="n">DDLogLevelDebug</span><span class="p">;</span>
</code></pre>
<p>This global log level will be used as a default unless stated otherwise. See below for possible levels you can set this to.</p>
<h3 id='convert-your-nslog-statements-to-ddlog' class='heading'>Convert your NSLog statements to DDLog</h3>
<p>The DDLog header file defines the macros that you will use to replace your NSLog statements. Essentially they look like this:</p>
<pre class="highlight objective_c"><code><span class="c1">// Convert from this:
</span><span class="n">NSLog</span><span class="p">(</span><span class="s">@"Broken sprocket detected!"</span><span class="p">);</span>
<span class="n">NSLog</span><span class="p">(</span><span class="s">@"User selected file:%@ withSize:%u"</span><span class="p">,</span> <span class="n">filePath</span><span class="p">,</span> <span class="n">fileSize</span><span class="p">);</span>
<span class="c1">// To this:
</span><span class="n">DDLogError</span><span class="p">(</span><span class="s">@"Broken sprocket detected!"</span><span class="p">);</span>
<span class="n">DDLogVerbose</span><span class="p">(</span><span class="s">@"User selected file:%@ withSize:%u"</span><span class="p">,</span> <span class="n">filePath</span><span class="p">,</span> <span class="n">fileSize</span><span class="p">);</span>
</code></pre>
<p>As you can see, the <strong>DDLog macros have the exact same syntax as NSLog</strong>.</p>
<p>So all you need to do is decide which log level each NSLog statement belongs to. By default, there are 5 options available:</p>
<ul>
<li>DDLogError</li>
<li>DDLogWarn</li>
<li>DDLogInfo</li>
<li>DDLogDebug</li>
<li>DDLogVerbose</li>
</ul>
<p>(You can also <a href="CustomLogLevels.md">customize the levels or the level names</a>. Or you can <a href="FineGrainedLogging.md">add fine-grained control on top of or instead of simple levels</a>.)</p>
<p>Which log level you choose per NSLog statement depends, of course, on the severity of the message.</p>
<p>These tie into the log level just as you would expect</p>
<ul>
<li>If you set the log level to DDLogLevelError, then you will only see Error statements.</li>
<li>If you set the log level to DDLogLevelWarn, then you will only see Error and Warn statements.</li>
<li>If you set the log level to DDLogLevelInfo, you’ll see Error, Warn and Info statements.</li>
<li>If you set the log level to DDLogLevelDebug, you’ll see Error, Warn, Info and Debug statements.</li>
<li>If you set the log level to DDLogLevelVerbose, you’ll see all DDLog statements.</li>
<li>If you set the log level to DDLogLevelOff, you won’t see any DDLog statements.</li>
</ul>
<p>Where do I set the log level? Do I have to use a single log level for my entire project?</p>
<p>Of course not! We all know what it’s like to debug or add new features. You want verbose logging just for the part that you’re currently working on. The CocoaLumberjack framework gives you per file debugging control. So you can change the log level on just that file you’re editing.</p>
<p>(Of course there are many other advanced options, such as a global log level, per xcode configuration levels, per logger levels, etc. But we’ll get to that in another article.)</p>
<p>Here’s all it takes to convert your log statements:</p>
<pre class="highlight objective_c"><code><span class="c1">// CONVERT FROM THIS
</span>
<span class="cp">#import "Sprocket.h"
</span>
<span class="k">@implementation</span> <span class="nc">Sprocket</span>
<span class="k">-</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span><span class="n">someMethod</span>
<span class="p">{</span>
<span class="n">NSLog</span><span class="p">(</span><span class="s">@"Meet George Jetson"</span><span class="p">);</span>
<span class="p">}</span>
<span class="k">@end</span>
<span class="c1">// TO THIS
</span>
<span class="cp">#import "Sprocket.h"
#import "CocoaLumberjack.h"
</span>
<span class="k">static</span> <span class="k">const</span> <span class="n">DDLogLevel</span> <span class="n">ddLogLevel</span> <span class="o">=</span> <span class="n">DDLogLevelVerbose</span><span class="p">;</span>
<span class="k">@implementation</span> <span class="nc">Sprocket</span>
<span class="k">-</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span><span class="n">someMethod</span>
<span class="p">{</span>
<span class="n">DDLogVerbose</span><span class="p">(</span><span class="s">@"Meet George Jetson"</span><span class="p">);</span>
<span class="p">}</span>
<span class="k">@end</span>
</code></pre>
<p>Notice that the log level is declared as a constant. This means that DDLog statements above the log level threshold will be compiled out of your project (when your compiler has optimisations turned on, as it would for your release build).</p>
<h3 id='automatic-reference-counting-arc' class='heading'>Automatic Reference Counting (ARC)</h3>
<p>The latest versions of CocoaLumberjack use ARC. If you’re not using ARC in your project, learn how to properly flag the CocoaLumberjack files as ARC in your Xcode project on the <a href="ARC.md">ARC</a> page.</p>
<h3 id='learn-more-about-cocoalumberjack' class='heading'>Learn More about CocoaLumberjack</h3>
<p>This is just the tip of the iceberg.</p>
<p>Find out how to:</p>
<ul>
<li><a href="XcodeTricks.md">Automatically use different log levels for your debug vs release builds</a></li>
<li><a href="CustomLogLevels.md">Tailor the log levels to suite your needs</a></li>
<li><a href="PerLoggerLogLevels.md">Filter logs based on logger settings</a></li>
<li><a href="CustomFormatters.md">Write your own custom formatters</a></li>
<li><a href="CustomLoggers.md">Write your own custom loggers</a></li>
<li><a href="README.md">And more…</a></li>
</ul>
</section>
</section>
<section id="footer">
<p>© 2020 <a class="link" href="https://github.com/CocoaLumberjack/CocoaLumberjack" target="_blank" rel="external">CocoaLumberjack</a>. All rights reserved. (Last updated: 2020-11-21)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.6</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>