-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
575 lines (519 loc) · 34.6 KB
/
index.html
File metadata and controls
575 lines (519 loc) · 34.6 KB
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
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
<!DOCTYPE html>
<html lang="en">
<head>
<title>CocoaLumberjack 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="CocoaLumberjack 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" />
CocoaLumberjack 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 align="center" >
<img src="https://raw.githubusercontent.com/CocoaLumberjack/CocoaLumberjack/master/LumberjackLogo.png" title="Lumberjack logo" float=left>
</p>
<h1 id='cocoalumberjack' class='heading'>CocoaLumberjack</h1>
<p><img src="https://github.com/CocoaLumberjack/CocoaLumberjack/workflows/Unit%20Tests/badge.svg" alt="Unit Tests">
<a href="http://cocoadocs.org/docsets/CocoaLumberjack/"><img src="http://img.shields.io/cocoapods/v/CocoaLumberjack.svg?style=flat" alt="Pod Version"></a>
<a href="https://github.com/Carthage/Carthage"><img src="https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat" alt="Carthage compatible"></a>
<a href="http://cocoadocs.org/docsets/CocoaLumberjack/"><img src="http://img.shields.io/cocoapods/p/CocoaLumberjack.svg?style=flat" alt="Pod Platform"></a>
<a href="http://opensource.org/licenses/BSD-3-Clause"><img src="http://img.shields.io/cocoapods/l/CocoaLumberjack.svg?style=flat" alt="Pod License"></a>
<a href="https://codecov.io/gh/CocoaLumberjack/CocoaLumberjack"><img src="https://codecov.io/gh/CocoaLumberjack/CocoaLumberjack/branch/master/graph/badge.svg" alt="codecov"></a>
<a href="https://codebeat.co/projects/github-com-cocoalumberjack-cocoalumberjack-master"><img src="https://codebeat.co/badges/840b714a-c8f3-4936-ada4-363473cd4e6b" alt="codebeat badge"></a></p>
<p><strong>CocoaLumberjack</strong> is a fast & simple, yet powerful & flexible logging framework for macOS, iOS, tvOS and watchOS.</p>
<h2 id='how-to-get-started' class='heading'>How to get started</h2>
<p>First, install CocoaLumberjack via <a href="http://cocoapods.org">CocoaPods</a>, <a href="https://github.com/Carthage/Carthage">Carthage</a>, <a href="https://swift.org/package-manager/">Swift Package Manager</a> or manually.
Then use <code><a href="Classes/DDOSLogger.html">DDOSLogger</a></code> for iOS 10 and later, or <code><a href="Classes/DDTTYLogger.html">DDTTYLogger</a></code> and <code><a href="Classes/DDASLLogger.html">DDASLLogger</a></code> for earlier versions to begin logging messages.</p>
<h3 id='cocoapods' class='heading'>CocoaPods</h3>
<pre class="highlight ruby"><code><span class="n">platform</span> <span class="ss">:ios</span><span class="p">,</span> <span class="s1">'9.0'</span>
<span class="n">target</span> <span class="s1">'SampleTarget'</span> <span class="k">do</span>
<span class="n">use_frameworks!</span>
<span class="n">pod</span> <span class="s1">'CocoaLumberjack/Swift'</span>
<span class="k">end</span>
</code></pre>
<p>Note: <code>Swift</code> is a subspec which will include all the Obj-C code plus the Swift one, so this is sufficient.
For more details about how to use Swift with Lumberjack, see <a href="https://github.com/CocoaLumberjack/CocoaLumberjack/issues/405">this conversation</a>.</p>
<p>For Objective-C use the following:</p>
<pre class="highlight ruby"><code><span class="n">platform</span> <span class="ss">:ios</span><span class="p">,</span> <span class="s1">'9.0'</span>
<span class="n">target</span> <span class="s1">'SampleTarget'</span> <span class="k">do</span>
<span class="n">pod</span> <span class="s1">'CocoaLumberjack'</span>
<span class="k">end</span>
</code></pre>
<h3 id='carthage' class='heading'>Carthage</h3>
<p>Carthage is a lightweight dependency manager for Swift and Objective-C. It leverages CocoaTouch modules and is less invasive than CocoaPods.</p>
<p>To install with Carthage, follow the instruction on <a href="https://github.com/Carthage/Carthage">Carthage</a></p>
<p>Cartfile</p>
<pre class="highlight plaintext"><code>github "CocoaLumberjack/CocoaLumberjack"
</code></pre>
<h3 id='swift-package-manager' class='heading'>Swift Package Manager</h3>
<p>As of CocoaLumberjack 3.6.0, you can use the Swift Package Manager as integration method.
If you want to use the Swift Package Manager as integration method, either use Xcode to add the package dependency or add the following dependency to your Package.swift:</p>
<pre class="highlight swift"><code><span class="o">.</span><span class="nf">package</span><span class="p">(</span><span class="nv">url</span><span class="p">:</span> <span class="s">"https://github.com/CocoaLumberjack/CocoaLumberjack.git"</span><span class="p">,</span> <span class="nv">from</span><span class="p">:</span> <span class="s">"3.7.0"</span><span class="p">),</span>
</code></pre>
<p>Note that you may need to add both products, <code>CocoaLumberjack</code> and <code>CocoaLumberjackSwift</code> to your target since SPM sometimes fails to detect that <code>CocoaLumerjackSwift</code> depends on <code>CocoaLumberjack</code>.</p>
<h3 id='install-manually' class='heading'>Install manually</h3>
<p>If you want to install CocoaLumberjack manually, read the <a href="https://raw.githubusercontent.com/CocoaLumberjack/CocoaLumberjack/master/Documentation/GettingStarted.md#manual-installation">manual installation</a> guide for more information.</p>
<h3 id='swift-usage' class='heading'>Swift Usage</h3>
<p>Usually, you can simply <code>import CocoaLumberjackSwift</code>. If you installed CocoaLumberjack using CocoaPods, you need to use <code>import CocoaLumberjack</code> instead.</p>
<pre class="highlight swift"><code><span class="kt">DDLog</span><span class="o">.</span><span class="nf">add</span><span class="p">(</span><span class="kt">DDOSLogger</span><span class="o">.</span><span class="n">sharedInstance</span><span class="p">)</span> <span class="c1">// Uses os_log</span>
<span class="k">let</span> <span class="nv">fileLogger</span><span class="p">:</span> <span class="kt">DDFileLogger</span> <span class="o">=</span> <span class="kt">DDFileLogger</span><span class="p">()</span> <span class="c1">// File Logger</span>
<span class="n">fileLogger</span><span class="o">.</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="c1">// 24 hours</span>
<span class="n">fileLogger</span><span class="o">.</span><span class="n">logFileManager</span><span class="o">.</span><span class="n">maximumNumberOfLogFiles</span> <span class="o">=</span> <span class="mi">7</span>
<span class="kt">DDLog</span><span class="o">.</span><span class="nf">add</span><span class="p">(</span><span class="n">fileLogger</span><span class="p">)</span>
<span class="o">...</span>
<span class="kt">DDLogVerbose</span><span class="p">(</span><span class="s">"Verbose"</span><span class="p">)</span>
<span class="kt">DDLogDebug</span><span class="p">(</span><span class="s">"Debug"</span><span class="p">)</span>
<span class="kt">DDLogInfo</span><span class="p">(</span><span class="s">"Info"</span><span class="p">)</span>
<span class="kt">DDLogWarn</span><span class="p">(</span><span class="s">"Warn"</span><span class="p">)</span>
<span class="kt">DDLogError</span><span class="p">(</span><span class="s">"Error"</span><span class="p">)</span>
</code></pre>
<h3 id='obj-c-usage' class='heading'>Obj-C usage</h3>
<p>If you’re using Lumberjack as a framework, you can <code>@import CocoaLumberjack;</code>.
Otherwise, <code>#import <CocoaLumberjack/CocoaLumberjack.h></code></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> <span class="c1">// Uses os_log
</span>
<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="c1">// File Logger
</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>
<span class="p">...</span>
<span class="n">DDLogVerbose</span><span class="p">(</span><span class="s">@"Verbose"</span><span class="p">);</span>
<span class="n">DDLogDebug</span><span class="p">(</span><span class="s">@"Debug"</span><span class="p">);</span>
<span class="n">DDLogInfo</span><span class="p">(</span><span class="s">@"Info"</span><span class="p">);</span>
<span class="n">DDLogWarn</span><span class="p">(</span><span class="s">@"Warn"</span><span class="p">);</span>
<span class="n">DDLogError</span><span class="p">(</span><span class="s">@"Error"</span><span class="p">);</span>
</code></pre>
<h3 id='objective-c-arc-semantic-issue' class='heading'>Objective-C ARC Semantic Issue</h3>
<p>When integrating Lumberjack into an existing Objective-C it is possible to run into <code>Multiple methods named 'tag' found with mismatched result, parameter type or attributes</code> build error.</p>
<p>Add <code>#define DD_LEGACY_MESSAGE_TAG 0</code> before importing CocoaLumberjack or add <code>#define DD_LEGACY_MESSAGE_TAG 0</code> or add <code>-DDD_LEGACY_MESSAGE_TAG=0</code> to <em>Other C Flags</em>/<em>OTHER_CFLAGS</em> in your Xcode project.</p>
<h2 id='a-href-https-github-com-apple-swift-log-swift-log-a-backend' class='heading'><a href="https://github.com/apple/swift-log">swift-log</a> backend</h2>
<p>CocoaLumberjack also ships with a backend implementation for <a href="https://github.com/apple/swift-log">swift-log</a>.
Simply add CocoaLumberjack as dependency to your SPM target (see above) and also add the <code>CocoaLumberjackSwiftLogBackend</code> product as dependency to your target.</p>
<p>You can then use <code>DDLogHandler</code> as backend for swift-log, which will forward all messages to CocoaLumberjack’s <code><a href="Classes/DDLog.html">DDLog</a></code>. You will still configure the loggers and log formatters you want via <code><a href="Classes/DDLog.html">DDLog</a></code>, but writing log messages will be done using <code>Logger</code> from swift-log.</p>
<p>In your own log formatters, you can make use of the <code>swiftLogInfo</code> property on <code><a href="Classes/DDLogMessage.html">DDLogMessage</a></code> to retrieve the details of a message that is logged via swift-log.</p>
<h3 id='more-information' class='heading'>More information</h3>
<ul>
<li>read the <a href="https://raw.githubusercontent.com/CocoaLumberjack/CocoaLumberjack/master/Documentation/GettingStarted.md">Getting started</a> guide, check out the <a href="https://raw.githubusercontent.com/CocoaLumberjack/CocoaLumberjack/master/Documentation/FAQ.md">FAQ</a> section or the other <a href="Documentation/">docs</a></li>
<li>if you find issues or want to suggest improvements, create an issue or a pull request</li>
<li>for all kinds of questions involving CocoaLumberjack, use the <a href="http://groups.google.com/group/cocoalumberjack">Google group</a> or StackOverflow (use <a href="http://stackoverflow.com/questions/tagged/lumberjack">#lumberjack</a>).</li>
</ul>
<h2 id='cocoalumberjack-3' class='heading'>CocoaLumberjack 3</h2>
<h3 id='migrating-to-3-x' class='heading'>Migrating to 3.x</h3>
<ul>
<li>To be determined</li>
</ul>
<h2 id='features' class='heading'>Features</h2>
<h3 id='lumberjack-is-fast-amp-simple-yet-powerful-amp-flexible' class='heading'>Lumberjack is Fast & Simple, yet Powerful & Flexible.</h3>
<p>It is similar in concept to other popular logging frameworks such as log4j, yet is designed specifically for Objective-C, and takes advantage of features such as multi-threading, grand central dispatch (if available), lockless atomic operations, and the dynamic nature of the Objective-C runtime.</p>
<h3 id='lumberjack-is-fast' class='heading'>Lumberjack is Fast</h3>
<p>In most cases it is an order of magnitude faster than NSLog.</p>
<h3 id='lumberjack-is-simple' class='heading'>Lumberjack is Simple</h3>
<p>It takes as little as a single line of code to configure lumberjack when your application launches. Then simply replace your NSLog statements with DDLog statements and that’s about it. (And the DDLog macros have the exact same format and syntax as NSLog, so it’s super easy.)</p>
<h3 id='lumberjack-is-powerful' class='heading'>Lumberjack is Powerful:</h3>
<p>One log statement can be sent to multiple loggers, meaning you can log to a file and the console simultaneously. Want more? Create your own loggers (it’s easy) and send your log statements over the network. Or to a database or distributed file system. The sky is the limit.</p>
<h3 id='lumberjack-is-flexible' class='heading'>Lumberjack is Flexible:</h3>
<p>Configure your logging however you want. Change log levels per file (perfect for debugging). Change log levels per logger (verbose console, but concise log file). Change log levels per xcode configuration (verbose debug, but concise release). Have your log statements compiled out of the release build. Customize the number of log levels for your application. Add your own fine-grained logging. Dynamically change log levels during runtime. Choose how & when you want your log files to be rolled. Upload your log files to a central server. Compress archived log files to save disk space…</p>
<h2 id='this-framework-is-for-you-if' class='heading'>This framework is for you if:</h2>
<ul>
<li>You’re looking for a way to track down that impossible-to-reproduce bug that keeps popping up in the field.</li>
<li>You’re frustrated with the super short console log on the iPhone.</li>
<li>You’re looking to take your application to the next level in terms of support and stability.</li>
<li>You’re looking for an enterprise level logging solution for your application (Mac or iPhone).</li>
</ul>
<h2 id='documentation' class='heading'>Documentation</h2>
<ul>
<li><strong><a href="https://github.com/CocoaLumberjack/CocoaLumberjack/blob/master/Documentation/GettingStarted.md">Get started using Lumberjack</a></strong><br/></li>
<li><a href="https://github.com/CocoaLumberjack/CocoaLumberjack/blob/master/Documentation/XcodeTricks.md">Different log levels for Debug and Release builds</a><br/></li>
<li><a href="https://github.com/CocoaLumberjack/CocoaLumberjack/blob/master/Documentation/PerLoggerLogLevels.md">Different log levels for each logger</a><br/></li>
<li><a href="https://github.com/CocoaLumberjack/CocoaLumberjack/blob/master/Documentation/XcodeColors.md">Use colors in the Xcode debugging console</a><br/></li>
<li><a href="https://github.com/CocoaLumberjack/CocoaLumberjack/blob/master/Documentation/CustomFormatters.md">Write your own custom formatters</a><br/></li>
<li><a href="https://github.com/CocoaLumberjack/CocoaLumberjack/blob/master/Documentation/FAQ.md">FAQ</a><br/></li>
<li><a href="https://github.com/CocoaLumberjack/CocoaLumberjack/blob/master/Documentation/Performance.md">Analysis of performance with benchmarks</a><br/></li>
<li><a href="https://github.com/CocoaLumberjack/CocoaLumberjack/blob/master/Documentation/ProblemSolution.md">Common issues you may encounter and their solutions</a><br/></li>
<li><a href="https://github.com/CocoaLumberjack/CocoaLumberjack/blob/master/Documentation/AppCode-support.md">AppCode support</a></li>
<li><strong><a href="Documentation/">Full Lumberjack documentation</a></strong><br/></li>
</ul>
<h2 id='requirements' class='heading'>Requirements</h2>
<p>The current version of Lumberjack requires:</p>
<ul>
<li>Xcode 12 or later</li>
<li>Swift 5.3 or later</li>
<li>iOS 9 or later</li>
<li>macOS 10.10 or later</li>
<li>watchOS 3 or later</li>
<li>tvOS 9 or later</li>
</ul>
<h3 id='backwards-compatibility' class='heading'>Backwards compatibility</h3>
<ul>
<li>for Xcode 11 and Swift up to 5.2, use the 3.6.2 version</li>
<li>for Xcode 10 and Swift 4.2, use the 3.5.2 version</li>
<li>for iOS 8, use the 3.6.1 version</li>
<li>for iOS 6, iOS 7, OS X 10.8, OS X 10.9 and Xcode 9, use the 3.4.2 version</li>
<li>for iOS 5 and OS X 10.7, use the 3.3 version</li>
<li>for Xcode 8 and Swift 3, use the 3.2 version</li>
<li>for Xcode 7.3 and Swift 2.3, use the 2.4.0 version</li>
<li>for Xcode 7.3 and Swift 2.2, use the 2.3.0 version</li>
<li>for Xcode 7.2 and 7.1, use the 2.2.0 version</li>
<li>for Xcode 7.0 or earlier, use the 2.1.0 version</li>
<li>for Xcode 6 or earlier, use the 2.0.x version</li>
<li>for OS X < 10.7 support, use the 1.6.0 version</li>
</ul>
<h2 id='communication' class='heading'>Communication</h2>
<ul>
<li>If you <strong>need help</strong>, use <a href="http://stackoverflow.com/questions/tagged/lumberjack">Stack Overflow</a>. (Tag ‘lumberjack’)</li>
<li>If you’d like to <strong>ask a general question</strong>, use <a href="http://stackoverflow.com/questions/tagged/lumberjack">Stack Overflow</a>.</li>
<li>If you <strong>found a bug</strong>, open an issue.</li>
<li>If you <strong>have a feature request</strong>, open an issue.</li>
<li>If you <strong>want to contribute</strong>, submit a pull request.</li>
</ul>
<h2 id='data-collection-practices' class='heading'>Data Collection Practices</h2>
<p>Per <a href="https://developer.apple.com/app-store/app-privacy-details/">App privacy details on the App Store</a>, Apple is requesting app developers to provide info about their data collection, us SDK maintainers must provide them with the same data.</p>
<h3 id='data-collection-by-the-framework' class='heading'>Data collection by the framework</h3>
<p><strong>By default, CocoaLumberjack does NOT collect any data on its own.</strong> </p>
<p><a href="https://cocoalumberjack.github.io/DataCollection/index.html">See our Data Collection Practices list.</a></p>
<h3 id='indirect-data-collection-through-the-framework' class='heading'>Indirect data collection through the framework</h3>
<p>CocoaLumberjack is a logging framework which makes it easy to send those logs to different platforms.</p>
<p>This is why collecting data might happen quite easily, if app developers include any sensitive data into their log messages.</p>
<p><strong>Important note: app developers are fully responsible for any sensitive data collected through our logging system!</strong></p>
<p>In consequence, you must comply to the Apple’s privacy details policy (mentioned above) and document the ways in which user data is being collected.
Since the number of scenarios where data might be indirectly collected through CocoaLumberjack is quite large, it’s up to you, as app developers, to properly review your app’s code and identify those cases.
What we can do to help is raise awareness about potential data collection through our framework.</p>
<p>Private data includes but isn’t limited to:</p>
<ul>
<li>user info (name, email, address, …)</li>
<li>location info</li>
<li>contacts</li>
<li>identifiers (user id, device id, …)</li>
<li>app usage data</li>
<li>performance data</li>
<li>health and fitness info</li>
<li>financial info</li>
<li>sensitive info</li>
<li>user content</li>
<li>history (browsing, search, …)</li>
<li>purchases</li>
<li>diagnostics</li>
<li>…</li>
</ul>
<p><em>Example</em>: <code>DDLogInfo("User: \(myUser)")</code> will add the <code>myUser</code> info to the logs, so if those are forwarded to a 3rd party or sent via email, that may qualify as data collection.</p>
<h2 id='author' class='heading'>Author</h2>
<ul>
<li><a href="https://github.com/robbiehanson">Robbie Hanson</a></li>
<li>Love the project? Wanna buy me a coffee? (or a beer :D) <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UZRA26JPJB3DA"><img src="http://www.paypal.com/en_US/i/btn/btn_donate_SM.gif" alt="donation"></a></li>
</ul>
<h2 id='collaborators' class='heading'>Collaborators</h2>
<ul>
<li><a href="https://github.com/rivera-ernesto">Ernesto Rivera</a></li>
<li><a href="https://github.com/dvor">Dmitry Vorobyov</a></li>
<li><a href="https://github.com/bpoplauschi">Bogdan Poplauschi</a></li>
<li><a href="https://github.com/MaddTheSane">C.W. Betts</a></li>
<li><a href="https://github.com/sushichop">Koichi Yokota (sushichop)</a></li>
<li><a href="https://github.com/nrbrook">Nick Brook</a></li>
<li><a href="https://github.com/ffried">Florian Friedrich</a></li>
<li><a href="https://github.com/diederich">Stephan Diederich</a></li>
<li><a href="https://github.com/ksuther">Kent Sutherland</a></li>
<li><a href="https://github.com/lolgear">Dmitry Lobanov</a></li>
<li><a href="https://github.com/hhanesand">Hakon Hanesand</a></li>
</ul>
<h2 id='license' class='heading'>License</h2>
<ul>
<li>CocoaLumberjack is available under the BSD 3 license. See the <a href="https://github.com/CocoaLumberjack/CocoaLumberjack/blob/master/LICENSE">LICENSE file</a>.</li>
</ul>
<h2 id='extensions' class='heading'>Extensions</h2>
<ul>
<li><a href="https://github.com/s4nchez/LogIO-CocoaLumberjack">LogIO-CocoaLumberjack</a> A log.io logger for CocoaLumberjack</li>
<li><a href="https://github.com/0xced/XCDLumberjackNSLogger">XCDLumberjackNSLogger</a> CocoaLumberjack logger which sends logs to NSLogger</li>
</ul>
<h2 id='architecture' class='heading'>Architecture</h2>
<p align="center" >
<img src="https://raw.githubusercontent.com/CocoaLumberjack/CocoaLumberjack/master/Documentation/CocoaLumberjackClassDiagram.png" title="CocoaLumberjack class diagram">
</p>
</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>