Files

1237 lines
66 KiB
HTML
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Log Struct 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>
</head>
<body>
<a name="//apple_ref/swift/Struct/Log" class="dashAnchor"></a>
<a title="Log Struct Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">CleanroomLogger Docs</a> (100% documented)</p>
<p class="header-right"><a href="https://github.com/emaloney/CleanroomLogger"><img src="../img/gh.png"/>View on GitHub</a></p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">CleanroomLogger Reference</a>
<img id="carat" src="../img/carat.png" />
Log Struct Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/BasicLogConfiguration.html">BasicLogConfiguration</a>
</li>
<li class="nav-group-task">
<a href="../Classes/BufferedLogEntryMessageRecorder.html">BufferedLogEntryMessageRecorder</a>
</li>
<li class="nav-group-task">
<a href="../Classes/BufferedLogEntryRecorder.html">BufferedLogEntryRecorder</a>
</li>
<li class="nav-group-task">
<a href="../Classes/BufferedLogRecorder.html">BufferedLogRecorder</a>
</li>
<li class="nav-group-task">
<a href="../Classes/BufferedMessageRecorder.html">BufferedMessageRecorder</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ConcatenatingLogFormatter.html">ConcatenatingLogFormatter</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ConsoleLogConfiguration.html">ConsoleLogConfiguration</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ConsoleLogConfiguration/StandardStreamsMode.html">– StandardStreamsMode</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FieldBasedLogFormatter.html">FieldBasedLogFormatter</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FieldBasedLogFormatter/Field.html">– Field</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FileLogRecorder.html">FileLogRecorder</a>
</li>
<li class="nav-group-task">
<a href="../Classes/LogReceptacle.html">LogReceptacle</a>
</li>
<li class="nav-group-task">
<a href="../Classes/LogRecorderBase.html">LogRecorderBase</a>
</li>
<li class="nav-group-task">
<a href="../Classes/OutputStreamLogRecorder.html">OutputStreamLogRecorder</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ParsableLogFormatter.html">ParsableLogFormatter</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ReadableLogFormatter.html">ReadableLogFormatter</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RotatingLogFileConfiguration.html">RotatingLogFileConfiguration</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RotatingLogFileRecorder.html">RotatingLogFileRecorder</a>
</li>
<li class="nav-group-task">
<a href="../Classes/StandardErrorLogRecorder.html">StandardErrorLogRecorder</a>
</li>
<li class="nav-group-task">
<a href="../Classes/StandardLogFormatter.html">StandardLogFormatter</a>
</li>
<li class="nav-group-task">
<a href="../Classes/StandardOutputLogRecorder.html">StandardOutputLogRecorder</a>
</li>
<li class="nav-group-task">
<a href="../Classes/StandardStreamsLogRecorder.html">StandardStreamsLogRecorder</a>
</li>
<li class="nav-group-task">
<a href="../Classes/XcodeLogConfiguration.html">XcodeLogConfiguration</a>
</li>
<li class="nav-group-task">
<a href="../Classes/XcodeLogFormatter.html">XcodeLogFormatter</a>
</li>
<li class="nav-group-task">
<a href="../Classes/XcodeTraceLogFormatter.html">XcodeTraceLogFormatter</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Enums.html">Enums</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Enums/CallingThreadStyle.html">CallingThreadStyle</a>
</li>
<li class="nav-group-task">
<a href="../Enums/DelimiterStyle.html">DelimiterStyle</a>
</li>
<li class="nav-group-task">
<a href="../Enums/LogSeverity.html">LogSeverity</a>
</li>
<li class="nav-group-task">
<a href="../Enums/OSLogTypeTranslator.html">OSLogTypeTranslator</a>
</li>
<li class="nav-group-task">
<a href="../Enums/SeverityStyle.html">SeverityStyle</a>
</li>
<li class="nav-group-task">
<a href="../Enums/SeverityStyle/TextRepresentation.html">– TextRepresentation</a>
</li>
<li class="nav-group-task">
<a href="../Enums/TimestampStyle.html">TimestampStyle</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/LogConfiguration.html">LogConfiguration</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/LogFilter.html">LogFilter</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/LogFormatter.html">LogFormatter</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/LogRecorder.html">LogRecorder</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Structs.html">Structs</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Structs/CallSiteLogFormatter.html">CallSiteLogFormatter</a>
</li>
<li class="nav-group-task">
<a href="../Structs/CallingThreadLogFormatter.html">CallingThreadLogFormatter</a>
</li>
<li class="nav-group-task">
<a href="../Structs/DelimiterLogFormatter.html">DelimiterLogFormatter</a>
</li>
<li class="nav-group-task">
<a href="../Structs/LiteralLogFormatter.html">LiteralLogFormatter</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Log.html">Log</a>
</li>
<li class="nav-group-task">
<a href="../Structs/LogChannel.html">LogChannel</a>
</li>
<li class="nav-group-task">
<a href="../Structs/LogEntry.html">LogEntry</a>
</li>
<li class="nav-group-task">
<a href="../Structs/LogEntry/Payload.html">– Payload</a>
</li>
<li class="nav-group-task">
<a href="../Structs/LogSeverityFilter.html">LogSeverityFilter</a>
</li>
<li class="nav-group-task">
<a href="../Structs/OSLogRecorder.html">OSLogRecorder</a>
</li>
<li class="nav-group-task">
<a href="../Structs/PayloadLogFormatter.html">PayloadLogFormatter</a>
</li>
<li class="nav-group-task">
<a href="../Structs/PayloadMessageLogFormatter.html">PayloadMessageLogFormatter</a>
</li>
<li class="nav-group-task">
<a href="../Structs/PayloadTraceLogFormatter.html">PayloadTraceLogFormatter</a>
</li>
<li class="nav-group-task">
<a href="../Structs/PayloadValueLogFormatter.html">PayloadValueLogFormatter</a>
</li>
<li class="nav-group-task">
<a href="../Structs/ProcessIDLogFormatter.html">ProcessIDLogFormatter</a>
</li>
<li class="nav-group-task">
<a href="../Structs/ProcessNameLogFormatter.html">ProcessNameLogFormatter</a>
</li>
<li class="nav-group-task">
<a href="../Structs/SeverityLogFormatter.html">SeverityLogFormatter</a>
</li>
<li class="nav-group-task">
<a href="../Structs/StackFrameLogFormatter.html">StackFrameLogFormatter</a>
</li>
<li class="nav-group-task">
<a href="../Structs/TimestampLogFormatter.html">TimestampLogFormatter</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>Log</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">Log</span></code></pre>
</div>
</div>
<p><code>Log</code> is the primary public API for CleanroomLogger.</p>
<p>If you wish to send a message to the log, you do so by calling the appropriae
function provided by the appropriate <code><a href="../Structs/LogChannel.html">LogChannel</a></code> given the importance of your
message.</p>
<p>There are five levels of severity at which log messages can be recorded. Each
level is represented by a read-only static variable maintained by the <code>Log</code>:</p>
<ul>
<li><p><code><a href="../Structs/Log.html#/s:15CleanroomLogger3LogV5errorAA0C7ChannelVSgvZ">Log.error</a></code> — The highest severity; something has gone wrong and a fatal error
may be imminent</p></li>
<li><p><code><a href="../Structs/Log.html#/s:15CleanroomLogger3LogV7warningAA0C7ChannelVSgvZ">Log.warning</a></code> — Something appears amiss and might bear looking into before a
larger problem arises</p></li>
<li><p><code><a href="../Structs/Log.html#/s:15CleanroomLogger3LogV4infoAA0C7ChannelVSgvZ">Log.info</a></code> — Something notable happened, but it isn&rsquo;t anything to worry about</p></li>
<li><p><code><a href="../Structs/Log.html#/s:15CleanroomLogger3LogV5debugAA0C7ChannelVSgvZ">Log.debug</a></code> — Used for debugging and diagnostic information</p></li>
<li><p><code><a href="../Structs/Log.html#/s:15CleanroomLogger3LogV7verboseAA0C7ChannelVSgvZ">Log.verbose</a></code> - The lowest severity; used for detailed or frequently occurring
debugging and diagnostic information</p></li>
</ul>
<p>Each <code><a href="../Structs/LogChannel.html">LogChannel</a></code> can be used in one of three ways:</p>
<ul>
<li>The <code>trace()</code> function records a short log message detailing the source
file, source line, and function name of the caller. It is intended to be called
with no arguments, as follows:</li>
</ul>
<pre class="highlight plaintext"><code>Log.debug?.trace()
</code></pre>
<ul>
<li>The <code>message()</code> function records a message specified by the caller:</li>
</ul>
<pre class="highlight plaintext"><code>Log.info?.message("The application has finished launching.")
</code></pre>
<p><code>message()</code> is intended to be called with a single parameter, the message
string, as shown above. Unlike <code>NSLog()</code>, no <code>printf</code>-like functionality
is provided; instead, use Swift string interpolation to construct parameterized
messages.</p>
<ul>
<li>Finally, the <code>value()</code> function records a string representation of an
arbitrary <code>Any</code> value:</li>
</ul>
<pre class="highlight plaintext"><code>Log.verbose?.value(delegate)
</code></pre>
<p>The <code>value()</code> function is intended to be called with a single parameter, of
type <code>Any?</code>.</p>
<p>The underlying logging implementation is responsible for converting this value
into a string representation.</p>
<p>Note that some implementations may not be able to convert certain values into
strings; in those cases, log requests may be silently ignored.</p>
<h3 id='enabling-logging' class='heading'>Enabling logging</h3>
<p>By default, logging is disabled, meaning that none of the <code>Log</code>&lsquo;s <em>log channels</em>
have been populated. As a result, attempts to perform any logging will silently
fail.</p>
<p>It is the responsibility of the <em>application developer</em> to enable logging, which
is done by calling the appropriate <code>Log.enable()</code> function.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:15CleanroomLogger3LogV5errorAA0C7ChannelVSgvZ"></a>
<a name="//apple_ref/swift/Variable/error" class="dashAnchor"></a>
<a class="token" href="#/s:15CleanroomLogger3LogV5errorAA0C7ChannelVSgvZ">error</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The <code><a href="../Structs/LogChannel.html">LogChannel</a></code> that can be used to perform logging at the <code>.error</code>
log severity level. Will be <code>nil</code> if logging hasn&rsquo;t yet been enabled, or
if logging for the <code>.error</code> severity has not been configured.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">private(set)</span> <span class="kd">static</span> <span class="k">var</span> <span class="nv">error</span><span class="p">:</span> <span class="kt"><a href="../Structs/LogChannel.html">LogChannel</a></span><span class="p">?</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:15CleanroomLogger3LogV7warningAA0C7ChannelVSgvZ"></a>
<a name="//apple_ref/swift/Variable/warning" class="dashAnchor"></a>
<a class="token" href="#/s:15CleanroomLogger3LogV7warningAA0C7ChannelVSgvZ">warning</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The <code><a href="../Structs/LogChannel.html">LogChannel</a></code> that can be used to perform logging at the <code>.warning</code>
log severity level. Will be <code>nil</code> if logging hasn&rsquo;t yet been enabled, or
if logging for the <code>.warning</code> severity has not been configured.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">private(set)</span> <span class="kd">static</span> <span class="k">var</span> <span class="nv">warning</span><span class="p">:</span> <span class="kt"><a href="../Structs/LogChannel.html">LogChannel</a></span><span class="p">?</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:15CleanroomLogger3LogV4infoAA0C7ChannelVSgvZ"></a>
<a name="//apple_ref/swift/Variable/info" class="dashAnchor"></a>
<a class="token" href="#/s:15CleanroomLogger3LogV4infoAA0C7ChannelVSgvZ">info</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The <code><a href="../Structs/LogChannel.html">LogChannel</a></code> that can be used to perform logging at the <code>.info</code>
log severity level. Will be <code>nil</code> if logging hasn&rsquo;t yet been enabled, or
if logging for the <code>.info</code> severity has not been configured.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">private(set)</span> <span class="kd">static</span> <span class="k">var</span> <span class="nv">info</span><span class="p">:</span> <span class="kt"><a href="../Structs/LogChannel.html">LogChannel</a></span><span class="p">?</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:15CleanroomLogger3LogV5debugAA0C7ChannelVSgvZ"></a>
<a name="//apple_ref/swift/Variable/debug" class="dashAnchor"></a>
<a class="token" href="#/s:15CleanroomLogger3LogV5debugAA0C7ChannelVSgvZ">debug</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The <code><a href="../Structs/LogChannel.html">LogChannel</a></code> that can be used to perform logging at the <code>.debug</code>
log severity level. Will be <code>nil</code> if logging hasn&rsquo;t yet been enabled, or
if logging for the <code>.debug</code> severity has not been configured.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">private(set)</span> <span class="kd">static</span> <span class="k">var</span> <span class="nv">debug</span><span class="p">:</span> <span class="kt"><a href="../Structs/LogChannel.html">LogChannel</a></span><span class="p">?</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:15CleanroomLogger3LogV7verboseAA0C7ChannelVSgvZ"></a>
<a name="//apple_ref/swift/Variable/verbose" class="dashAnchor"></a>
<a class="token" href="#/s:15CleanroomLogger3LogV7verboseAA0C7ChannelVSgvZ">verbose</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The <code><a href="../Structs/LogChannel.html">LogChannel</a></code> that can be used to perform logging at the <code>.verbose</code>
log severity level. Will be <code>nil</code> if logging hasn&rsquo;t yet been enabled, or
if logging for the <code>.verbose</code> severity has not been configured.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">private(set)</span> <span class="kd">static</span> <span class="k">var</span> <span class="nv">verbose</span><span class="p">:</span> <span class="kt"><a href="../Structs/LogChannel.html">LogChannel</a></span><span class="p">?</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:15CleanroomLogger3LogV6enableyAA0C8SeverityO07minimumE0_Sb9debugModeSb012verboseDebugH0AA07ConsoleC13ConfigurationC015StandardStreamsH0O03stdnH0Sb16mimicOSLogOutputSb12showCallSiteSayAA0C6Filter_pG7filterstFZ"></a>
<a name="//apple_ref/swift/Method/enable(minimumSeverity:debugMode:verboseDebugMode:stdStreamsMode:mimicOSLogOutput:showCallSite:filters:)" class="dashAnchor"></a>
<a class="token" href="#/s:15CleanroomLogger3LogV6enableyAA0C8SeverityO07minimumE0_Sb9debugModeSb012verboseDebugH0AA07ConsoleC13ConfigurationC015StandardStreamsH0O03stdnH0Sb16mimicOSLogOutputSb12showCallSiteSayAA0C6Filter_pG7filterstFZ">enable(minimumSeverity:debugMode:verboseDebugMode:stdStreamsMode:mimicOSLogOutput:showCallSite:filters:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Enables logging using an <code><a href="../Classes/XcodeLogConfiguration.html">XcodeLogConfiguration</a></code>.</p>
<p>Log entries are recorded by being written to the Apple System Log and to
the <code>stderr</code> output stream of the running process. In Xcode, log entries
will appear in the console.</p>
<div class="aside aside-warning">
<p class="aside-title">Warning</p>
<p>Setting either <code>debugMode</code> or <code>verboseDebugMode</code> to <code>true</code> will
result in <code>synchronousMode</code> being used when recording log entries.
Synchronous mode is helpful while debugging, as it ensures that logs are
always up-to-date when debug breakpoints are hit. However, synchronous
mode can have a negative influence on performance and is therefore not
recommended for use in production code.</p>
</div>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="nf">enable</span><span class="p">(</span><span class="nv">minimumSeverity</span><span class="p">:</span> <span class="kt"><a href="../Enums/LogSeverity.html">LogSeverity</a></span> <span class="o">=</span> <span class="o">.</span><span class="n"><a href="../Structs/Log.html#/s:15CleanroomLogger3LogV4infoAA0C7ChannelVSgvZ">info</a></span><span class="p">,</span> <span class="nv">debugMode</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">false</span><span class="p">,</span> <span class="nv">verboseDebugMode</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">false</span><span class="p">,</span> <span class="nv">stdStreamsMode</span><span class="p">:</span> <span class="kt"><a href="../Classes/ConsoleLogConfiguration.html">ConsoleLogConfiguration</a></span><span class="o">.</span><span class="kt">StandardStreamsMode</span> <span class="o">=</span> <span class="o">.</span><span class="n">useAsFallback</span><span class="p">,</span> <span class="nv">mimicOSLogOutput</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span> <span class="nv">showCallSite</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span> <span class="nv">filters</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Protocols/LogFilter.html">LogFilter</a></span><span class="p">]</span> <span class="o">=</span> <span class="p">[])</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>minimumSeverity</em>
</code>
</td>
<td>
<div>
<p>The minimum supported <code>LogSeverity</code>. Any
<code>LogEntry</code> having a <code>severity</code> less than <code>minimumSeverity</code> will be silently
ignored.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>debugMode</em>
</code>
</td>
<td>
<div>
<p>If <code>true</code>, the value of <code>minimumSeverity</code> will
be lowered (if necessary) to <code>.debug</code> and <code>synchronousMode</code> will be used
when recording log entries.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>verboseDebugMode</em>
</code>
</td>
<td>
<div>
<p>If <code>true</code>, the value of <code>minimumSeverity</code>
will be lowered (if necessary) to <code>.verbose</code> and <code>synchronousMode</code> will be
used when recording log entries.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>stdStreamsMode</em>
</code>
</td>
<td>
<div>
<p>A <code>StandardStreamsMode</code> value that governs
when standard console streams (i.e., <code>stdout</code> and <code>stderr</code>) should be used
for recording log output.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>mimicOSLogOutput</em>
</code>
</td>
<td>
<div>
<p>If <code>true</code>, any output sent to <code>stdout</code> will
be formatted in such a way as to mimic the output seen when <code>os_log()</code> is
used.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>showCallSite</em>
</code>
</td>
<td>
<div>
<p>If <code>true</code>, the source file and line indicating
the call site of the log request will be added to formatted log messages.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>filters</em>
</code>
</td>
<td>
<div>
<p>The <code>LogFilter</code>s to use when deciding whether a given
<code>LogEntry</code> should be passed along for recording.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:15CleanroomLogger3LogV6enableyAA0C13Configuration_p13configuration_tFZ"></a>
<a name="//apple_ref/swift/Method/enable(configuration:)" class="dashAnchor"></a>
<a class="token" href="#/s:15CleanroomLogger3LogV6enableyAA0C13Configuration_p13configuration_tFZ">enable(configuration:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Enables logging using the specified <code><a href="../Protocols/LogConfiguration.html">LogConfiguration</a></code>.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="nf">enable</span><span class="p">(</span><span class="nv">configuration</span><span class="p">:</span> <span class="kt"><a href="../Protocols/LogConfiguration.html">LogConfiguration</a></span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>configuration</em>
</code>
</td>
<td>
<div>
<p>The <code>LogConfiguration</code> to use for controlling
the behavior of logging.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:15CleanroomLogger3LogV6enableySayAA0C13Configuration_pG13configuration_tFZ"></a>
<a name="//apple_ref/swift/Method/enable(configuration:)" class="dashAnchor"></a>
<a class="token" href="#/s:15CleanroomLogger3LogV6enableySayAA0C13Configuration_pG13configuration_tFZ">enable(configuration:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Enables logging using the specified <code><a href="../Protocols/LogConfiguration.html">LogConfiguration</a></code>s.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="nf">enable</span><span class="p">(</span><span class="nv">configuration</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Protocols/LogConfiguration.html">LogConfiguration</a></span><span class="p">])</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>configuration</em>
</code>
</td>
<td>
<div>
<p>An array of <code>LogConfiguration</code>s specifying
the behavior of logging.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:15CleanroomLogger3LogV6enableyAA0C10ReceptacleC10receptacle_tFZ"></a>
<a name="//apple_ref/swift/Method/enable(receptacle:)" class="dashAnchor"></a>
<a class="token" href="#/s:15CleanroomLogger3LogV6enableyAA0C10ReceptacleC10receptacle_tFZ">enable(receptacle:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Enables logging using the specified <code><a href="../Classes/LogReceptacle.html">LogReceptacle</a></code>.</p>
<p>Individual <code><a href="../Structs/LogChannel.html">LogChannel</a></code>s for <code><a href="../Structs/Log.html#/s:15CleanroomLogger3LogV5errorAA0C7ChannelVSgvZ">error</a></code>, <code><a href="../Structs/Log.html#/s:15CleanroomLogger3LogV7warningAA0C7ChannelVSgvZ">warning</a></code>, <code><a href="../Structs/Log.html#/s:15CleanroomLogger3LogV4infoAA0C7ChannelVSgvZ">info</a></code>, <code><a href="../Structs/Log.html#/s:15CleanroomLogger3LogV5debugAA0C7ChannelVSgvZ">debug</a></code>, and
<code><a href="../Structs/Log.html#/s:15CleanroomLogger3LogV7verboseAA0C7ChannelVSgvZ">verbose</a></code> may or may not be constructed depending on the receptacle&rsquo;s
<code>minimumSeverity</code>.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="nf">enable</span><span class="p">(</span><span class="nv">receptacle</span><span class="p">:</span> <span class="kt"><a href="../Classes/LogReceptacle.html">LogReceptacle</a></span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>receptacle</em>
</code>
</td>
<td>
<div>
<p>The <code>LogReceptacle</code> to use when creating the
<code>LogChannel</code>s for the five severity levels.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:15CleanroomLogger3LogV6enableyAA0C7ChannelVSg05errorE0_AG07warningE0AG04infoE0AG05debugE0AG07verboseE0tFZ"></a>
<a name="//apple_ref/swift/Method/enable(errorChannel:warningChannel:infoChannel:debugChannel:verboseChannel:)" class="dashAnchor"></a>
<a class="token" href="#/s:15CleanroomLogger3LogV6enableyAA0C7ChannelVSg05errorE0_AG07warningE0AG04infoE0AG05debugE0AG07verboseE0tFZ">enable(errorChannel:warningChannel:infoChannel:debugChannel:verboseChannel:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Enables logging using the specified <code><a href="../Structs/LogChannel.html">LogChannel</a></code>s.</p>
<p>The static <code><a href="../Structs/Log.html#/s:15CleanroomLogger3LogV5errorAA0C7ChannelVSgvZ">error</a></code>, <code><a href="../Structs/Log.html#/s:15CleanroomLogger3LogV7warningAA0C7ChannelVSgvZ">warning</a></code>, <code><a href="../Structs/Log.html#/s:15CleanroomLogger3LogV4infoAA0C7ChannelVSgvZ">info</a></code>, <code><a href="../Structs/Log.html#/s:15CleanroomLogger3LogV5debugAA0C7ChannelVSgvZ">debug</a></code>, and <code><a href="../Structs/Log.html#/s:15CleanroomLogger3LogV7verboseAA0C7ChannelVSgvZ">verbose</a></code> properties of
<code>Log</code> will be set using the specified values.</p>
<p>If you know that the configuration of a given <code><a href="../Structs/LogChannel.html">LogChannel</a></code> guarantees that
it will never perform logging, it is best to pass <code>nil</code> instead. Otherwise,
needless overhead will be added to the application.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="nf">enable</span><span class="p">(</span><span class="nv">errorChannel</span><span class="p">:</span> <span class="kt"><a href="../Structs/LogChannel.html">LogChannel</a></span><span class="p">?,</span> <span class="nv">warningChannel</span><span class="p">:</span> <span class="kt"><a href="../Structs/LogChannel.html">LogChannel</a></span><span class="p">?,</span> <span class="nv">infoChannel</span><span class="p">:</span> <span class="kt"><a href="../Structs/LogChannel.html">LogChannel</a></span><span class="p">?,</span> <span class="nv">debugChannel</span><span class="p">:</span> <span class="kt"><a href="../Structs/LogChannel.html">LogChannel</a></span><span class="p">?,</span> <span class="nv">verboseChannel</span><span class="p">:</span> <span class="kt"><a href="../Structs/LogChannel.html">LogChannel</a></span><span class="p">?)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>errorChannel</em>
</code>
</td>
<td>
<div>
<p>The <code>LogChannel</code> to use for logging messages with
a <code>severity</code> of <code>.error</code>.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>warningChannel</em>
</code>
</td>
<td>
<div>
<p>The <code>LogChannel</code> to use for logging messages
with a <code>severity</code> of <code>.warning</code>.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>infoChannel</em>
</code>
</td>
<td>
<div>
<p>The <code>LogChannel</code> to use for logging messages with
a <code>severity</code> of <code>.info</code>.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>debugChannel</em>
</code>
</td>
<td>
<div>
<p>The <code>LogChannel</code> to use for logging messages with
a <code>severity</code> of <code>.debug</code>.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>verboseChannel</em>
</code>
</td>
<td>
<div>
<p>The <code>LogChannel</code> to use for logging messages
with a <code>severity</code> of <code>.verbose</code>.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:15CleanroomLogger3LogV11neverEnableyyFZ"></a>
<a name="//apple_ref/swift/Method/neverEnable()" class="dashAnchor"></a>
<a class="token" href="#/s:15CleanroomLogger3LogV11neverEnableyyFZ">neverEnable()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Assuming CleanroomLogger has not yet been enabled, calling this function
prevents any other caller from enabling CleanroomLogger for the remainder
of the lifetime of the running executable.</p>
<p>The ability to prevent CleanroomLogger from being enabled may be useful
in applications that link against libraries requiring CleanroomLogger.
Application developers who did not choose to use CleanroomLogger can
ensure that embedded third-party libraries don&rsquo;t use it, either.</p>
<div class="aside aside-important">
<p class="aside-title">Important</p>
If <code>Log.enable()</code> has already been called, calling
<code>Log.neverEnable()</code> will have no effect.
</div>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="nf">neverEnable</span><span class="p">()</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:15CleanroomLogger3LogV7channelAA0C7ChannelVSgAA0C8SeverityO8severity_tFZ"></a>
<a name="//apple_ref/swift/Method/channel(severity:)" class="dashAnchor"></a>
<a class="token" href="#/s:15CleanroomLogger3LogV7channelAA0C7ChannelVSgAA0C8SeverityO8severity_tFZ">channel(severity:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Returns the <code><a href="../Structs/LogChannel.html">LogChannel</a></code> responsible for logging at the given severity.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="nf">channel</span><span class="p">(</span><span class="nv">severity</span><span class="p">:</span> <span class="kt"><a href="../Enums/LogSeverity.html">LogSeverity</a></span><span class="p">)</span>
<span class="o">-&gt;</span> <span class="kt"><a href="../Structs/LogChannel.html">LogChannel</a></span><span class="p">?</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>severity</em>
</code>
</td>
<td>
<div>
<p>The <code>LogSeverity</code> level of the <code>LogChannel</code> to
return.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>The <code><a href="../Structs/LogChannel.html">LogChannel</a></code> used by <code>Log</code> to perform logging at the given
severity; will be <code>nil</code> if <code>Log</code> is not configured to perform logging at
that severity.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:15CleanroomLogger3LogV5traceyAA0C8SeverityO_SS8functionSS8filePathSi0G4LinetFZ"></a>
<a name="//apple_ref/swift/Method/trace(_:function:filePath:fileLine:)" class="dashAnchor"></a>
<a class="token" href="#/s:15CleanroomLogger3LogV5traceyAA0C8SeverityO_SS8functionSS8filePathSi0G4LinetFZ">trace(_:function:filePath:fileLine:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Sends program execution trace information to the log using the specified
severity. This information includes source-level call site information as
well as the stack frame signature of the caller.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="nf">trace</span><span class="p">(</span><span class="n">_</span> <span class="nv">severity</span><span class="p">:</span> <span class="kt"><a href="../Enums/LogSeverity.html">LogSeverity</a></span><span class="p">,</span> <span class="nv">function</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="err">#</span><span class="n">function</span><span class="p">,</span> <span class="nv">filePath</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="err">#</span><span class="n">file</span><span class="p">,</span> <span class="nv">fileLine</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="err">#</span><span class="n">line</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>severity</em>
</code>
</td>
<td>
<div>
<p>The <code>LogSeverity</code> for the message being recorded.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>function</em>
</code>
</td>
<td>
<div>
<p>The default value provided for this parameter
captures the signature of the calling function. You should not provide a
value for this parameter.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>filePath</em>
</code>
</td>
<td>
<div>
<p>The default value provided for this parameter
captures the file path of the code issuing the call to this function.
You should not provide a value for this parameter.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>fileLine</em>
</code>
</td>
<td>
<div>
<p>The default value provided for this parameter
captures the line number issuing the call to this function. You should
not provide a value for this parameter.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:15CleanroomLogger3LogV7messageyAA0C8SeverityO_SSADSS8functionSS8filePathSi0G4LinetFZ"></a>
<a name="//apple_ref/swift/Method/message(_:message:function:filePath:fileLine:)" class="dashAnchor"></a>
<a class="token" href="#/s:15CleanroomLogger3LogV7messageyAA0C8SeverityO_SSADSS8functionSS8filePathSi0G4LinetFZ">message(_:message:function:filePath:fileLine:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Sends a message string to the log using the specified severity.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="nf">message</span><span class="p">(</span><span class="n">_</span> <span class="nv">severity</span><span class="p">:</span> <span class="kt"><a href="../Enums/LogSeverity.html">LogSeverity</a></span><span class="p">,</span> <span class="nv">message</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">function</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="err">#</span><span class="n">function</span><span class="p">,</span> <span class="nv">filePath</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="err">#</span><span class="n">file</span><span class="p">,</span> <span class="nv">fileLine</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="err">#</span><span class="n">line</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>severity</em>
</code>
</td>
<td>
<div>
<p>The <code>LogSeverity</code> for the log entry.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>msg</em>
</code>
</td>
<td>
<div>
<p>The message to log.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>function</em>
</code>
</td>
<td>
<div>
<p>The default value provided for this parameter
captures the signature of the calling function. You should not provide a
value for this parameter.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>filePath</em>
</code>
</td>
<td>
<div>
<p>The default value provided for this parameter
captures the file path of the code issuing the call to this function.
You should not provide a value for this parameter.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>fileLine</em>
</code>
</td>
<td>
<div>
<p>The default value provided for this parameter
captures the line number issuing the call to this function. You should
not provide a value for this parameter.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:15CleanroomLogger3LogV5valueyAA0C8SeverityO_ypSgADSS8functionSS8filePathSi0G4LinetFZ"></a>
<a name="//apple_ref/swift/Method/value(_:value:function:filePath:fileLine:)" class="dashAnchor"></a>
<a class="token" href="#/s:15CleanroomLogger3LogV5valueyAA0C8SeverityO_ypSgADSS8functionSS8filePathSi0G4LinetFZ">value(_:value:function:filePath:fileLine:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Sends an arbitrary value to the log using the specified severity.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="nf">value</span><span class="p">(</span><span class="n">_</span> <span class="nv">severity</span><span class="p">:</span> <span class="kt"><a href="../Enums/LogSeverity.html">LogSeverity</a></span><span class="p">,</span> <span class="nv">value</span><span class="p">:</span> <span class="kt">Any</span><span class="p">?,</span> <span class="nv">function</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="err">#</span><span class="n">function</span><span class="p">,</span> <span class="nv">filePath</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="err">#</span><span class="n">file</span><span class="p">,</span> <span class="nv">fileLine</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="err">#</span><span class="n">line</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>severity</em>
</code>
</td>
<td>
<div>
<p>The <code>LogSeverity</code> for the log entry.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>value</em>
</code>
</td>
<td>
<div>
<p>The value to send to the log. Determining how (and
whether) arbitrary values are captured and represented will be handled by
the <code>LogRecorder</code> implementation(s) that are ultimately called upon to
record the log entry.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>function</em>
</code>
</td>
<td>
<div>
<p>The default value provided for this parameter
captures the signature of the calling function. You should not provide a
value for this parameter.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>filePath</em>
</code>
</td>
<td>
<div>
<p>The default value provided for this parameter
captures the file path of the code issuing the call to this function.
You should not provide a value for this parameter.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>fileLine</em>
</code>
</td>
<td>
<div>
<p>The default value provided for this parameter
captures the line number issuing the call to this function. You should
not provide a value for this parameter.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>© 2015-2017 <a class="link" href="http://tech.gilt.com/" target="_blank" rel="external">Gilt Groupe</a></p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>