<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">{-
   OpenAPI Petstore

   This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \&quot; \\

   OpenAPI Version: 3.0.1
   OpenAPI Petstore API version: 1.0.0
   Generated by OpenAPI Generator (https://openapi-generator.tech)
-}</span><span>
</span><span id="line-10"></span><span>
</span><span id="line-11"></span><span class="annot"><span class="hs-comment">{-|
Module : OpenAPIPetstore.LoggingKatip
Katip Logging functions
-}</span></span><span>
</span><span id="line-15"></span><span>
</span><span id="line-16"></span><span class="hs-pragma">{-# LANGUAGE OverloadedStrings #-}</span><span>
</span><span id="line-17"></span><span class="hs-pragma">{-# LANGUAGE RankNTypes #-}</span><span>
</span><span id="line-18"></span><span class="hs-pragma">{-# LANGUAGE ScopedTypeVariables #-}</span><span>
</span><span id="line-19"></span><span>
</span><span id="line-20"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">OpenAPIPetstore.LoggingKatip</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-21"></span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><span class="hs-identifier">Control.Exception.Safe</span></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">E</span></span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><span class="hs-identifier">Control.Monad.IO.Class</span></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">P</span></span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><span class="hs-identifier">Control.Monad.Trans.Reader</span></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">P</span></span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><span class="hs-identifier">Data.Text</span></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">T</span></span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><span class="hs-identifier">Lens.Micro</span></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">L</span></span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><span class="hs-identifier">System.IO</span></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">IO</span></span><span>
</span><span id="line-28"></span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><span class="hs-identifier">Data.Text</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier">Text</span></span><span class="hs-special">)</span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><span class="hs-identifier">GHC.Exts</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier">IsString</span></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-31"></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><span class="hs-identifier">Katip</span></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">LG</span></span><span>
</span><span id="line-33"></span><span>
</span><span id="line-34"></span><span class="annot"><span class="hs-comment">-- * Type Aliases (for compatibility)</span></span><span>
</span><span id="line-35"></span><span>
</span><span id="line-36"></span><span class="annot"><span class="hs-comment">-- | Runs a Katip logging block with the Log environment</span></span><span>
</span><span id="line-37"></span><span class="hs-keyword">type</span><span> </span><span id="LogExecWithContext"><span class="annot"><a href="OpenAPIPetstore.LoggingKatip.html#LogExecWithContext"><span class="hs-identifier hs-var">LogExecWithContext</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621679154251"><span class="annot"><a href="#local-6989586621679154251"><span class="hs-identifier hs-type">m</span></a></span></span><span> </span><span id="local-6989586621679154252"><span class="annot"><a href="#local-6989586621679154252"><span class="hs-identifier hs-type">a</span></a></span></span><span class="hs-operator">.</span><span> </span><span class="annot"><span class="hs-identifier hs-type">P.MonadIO</span></span><span> </span><span class="annot"><a href="#local-6989586621679154251"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span>
</span><span id="line-38"></span><span>                                      </span><span class="annot"><a href="OpenAPIPetstore.LoggingKatip.html#LogContext"><span class="hs-identifier hs-type">LogContext</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="OpenAPIPetstore.LoggingKatip.html#LogExec"><span class="hs-identifier hs-type">LogExec</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679154251"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679154252"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-39"></span><span>
</span><span id="line-40"></span><span class="annot"><span class="hs-comment">-- | A Katip logging block</span></span><span>
</span><span id="line-41"></span><span class="hs-keyword">type</span><span> </span><span id="LogExec"><span class="annot"><a href="OpenAPIPetstore.LoggingKatip.html#LogExec"><span class="hs-identifier hs-var">LogExec</span></a></span></span><span> </span><span id="local-6989586621679154253"><span class="annot"><a href="#local-6989586621679154253"><span class="hs-identifier hs-type">m</span></a></span></span><span> </span><span id="local-6989586621679154254"><span class="annot"><a href="#local-6989586621679154254"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="hs-identifier hs-type">LG.KatipT</span></span><span> </span><span class="annot"><a href="#local-6989586621679154253"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679154254"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679154253"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679154254"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-42"></span><span>
</span><span id="line-43"></span><span class="annot"><span class="hs-comment">-- | A Katip Log environment</span></span><span>
</span><span id="line-44"></span><span class="hs-keyword">type</span><span> </span><span id="LogContext"><span class="annot"><a href="OpenAPIPetstore.LoggingKatip.html#LogContext"><span class="hs-identifier hs-var">LogContext</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="hs-identifier hs-type">LG.LogEnv</span></span><span>
</span><span id="line-45"></span><span>
</span><span id="line-46"></span><span class="annot"><span class="hs-comment">-- | A Katip Log severity</span></span><span>
</span><span id="line-47"></span><span class="hs-keyword">type</span><span> </span><span id="LogLevel"><span class="annot"><a href="OpenAPIPetstore.LoggingKatip.html#LogLevel"><span class="hs-identifier hs-var">LogLevel</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="hs-identifier hs-type">LG.Severity</span></span><span>
</span><span id="line-48"></span><span>
</span><span id="line-49"></span><span class="annot"><span class="hs-comment">-- * default logger</span></span><span>
</span><span id="line-50"></span><span>
</span><span id="line-51"></span><span class="annot"><span class="hs-comment">-- | the default log environment</span></span><span>
</span><span id="line-52"></span><span class="annot"><a href="OpenAPIPetstore.LoggingKatip.html#initLogContext"><span class="hs-identifier hs-type">initLogContext</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="OpenAPIPetstore.LoggingKatip.html#LogContext"><span class="hs-identifier hs-type">LogContext</span></a></span><span>
</span><span id="line-53"></span><span id="initLogContext"><span class="annot"><span class="annottext">initLogContext :: IO LogContext
</span><a href="OpenAPIPetstore.LoggingKatip.html#initLogContext"><span class="hs-identifier hs-var hs-var">initLogContext</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Namespace -&gt; Environment -&gt; IO LogContext
</span><span class="hs-identifier hs-var">LG.initLogEnv</span></span><span> </span><span class="annot"><span class="annottext">Namespace
</span><span class="hs-string">&quot;OpenAPIPetstore&quot;</span></span><span> </span><span class="annot"><span class="annottext">Environment
</span><span class="hs-string">&quot;dev&quot;</span></span><span>
</span><span id="line-54"></span><span>
</span><span id="line-55"></span><span class="annot"><span class="hs-comment">-- | Runs a Katip logging block with the Log environment</span></span><span>
</span><span id="line-56"></span><span class="annot"><a href="OpenAPIPetstore.LoggingKatip.html#runDefaultLogExecWithContext"><span class="hs-identifier hs-type">runDefaultLogExecWithContext</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="OpenAPIPetstore.LoggingKatip.html#LogExecWithContext"><span class="hs-identifier hs-type">LogExecWithContext</span></a></span><span>
</span><span id="line-57"></span><span id="runDefaultLogExecWithContext"><span class="annot"><span class="annottext">runDefaultLogExecWithContext :: LogExecWithContext
</span><a href="OpenAPIPetstore.LoggingKatip.html#runDefaultLogExecWithContext"><span class="hs-identifier hs-var hs-var">runDefaultLogExecWithContext</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LogContext -&gt; KatipT m a -&gt; m a
forall (m :: * -&gt; *) a. LogContext -&gt; KatipT m a -&gt; m a
</span><span class="hs-identifier hs-var">LG.runKatipT</span></span><span>
</span><span id="line-58"></span><span>
</span><span id="line-59"></span><span class="annot"><span class="hs-comment">-- * stdout logger</span></span><span>
</span><span id="line-60"></span><span>
</span><span id="line-61"></span><span class="annot"><span class="hs-comment">-- | Runs a Katip logging block with the Log environment</span></span><span>
</span><span id="line-62"></span><span class="annot"><a href="OpenAPIPetstore.LoggingKatip.html#stdoutLoggingExec"><span class="hs-identifier hs-type">stdoutLoggingExec</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="OpenAPIPetstore.LoggingKatip.html#LogExecWithContext"><span class="hs-identifier hs-type">LogExecWithContext</span></a></span><span>
</span><span id="line-63"></span><span id="stdoutLoggingExec"><span class="annot"><span class="annottext">stdoutLoggingExec :: LogExecWithContext
</span><a href="OpenAPIPetstore.LoggingKatip.html#stdoutLoggingExec"><span class="hs-identifier hs-var hs-var">stdoutLoggingExec</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LogContext -&gt; LogExec m a
LogExecWithContext
</span><a href="OpenAPIPetstore.LoggingKatip.html#runDefaultLogExecWithContext"><span class="hs-identifier hs-var">runDefaultLogExecWithContext</span></a></span><span>
</span><span id="line-64"></span><span>
</span><span id="line-65"></span><span class="annot"><span class="hs-comment">-- | A Katip Log environment which targets stdout</span></span><span>
</span><span id="line-66"></span><span class="annot"><a href="OpenAPIPetstore.LoggingKatip.html#stdoutLoggingContext"><span class="hs-identifier hs-type">stdoutLoggingContext</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="OpenAPIPetstore.LoggingKatip.html#LogContext"><span class="hs-identifier hs-type">LogContext</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="OpenAPIPetstore.LoggingKatip.html#LogContext"><span class="hs-identifier hs-type">LogContext</span></a></span><span>
</span><span id="line-67"></span><span id="stdoutLoggingContext"><span class="annot"><span class="annottext">stdoutLoggingContext :: LogContext -&gt; IO LogContext
</span><a href="OpenAPIPetstore.LoggingKatip.html#stdoutLoggingContext"><span class="hs-identifier hs-var hs-var">stdoutLoggingContext</span></a></span></span><span> </span><span id="local-6989586621679154266"><span class="annot"><span class="annottext">LogContext
</span><a href="#local-6989586621679154266"><span class="hs-identifier hs-var">cxt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-68"></span><span>    </span><span id="local-6989586621679154267"><span class="annot"><span class="annottext">Scribe
</span><a href="#local-6989586621679154267"><span class="hs-identifier hs-var">handleScribe</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ColorStrategy -&gt; Handle -&gt; PermitFunc -&gt; Verbosity -&gt; IO Scribe
</span><span class="hs-identifier hs-var">LG.mkHandleScribe</span></span><span> </span><span class="annot"><span class="annottext">ColorStrategy
</span><span class="hs-identifier hs-var">LG.ColorIfTerminal</span></span><span> </span><span class="annot"><span class="annottext">Handle
</span><span class="hs-identifier hs-var">IO.stdout</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Severity -&gt; Item a -&gt; IO Bool
forall (m :: * -&gt; *) a. Monad m =&gt; Severity -&gt; Item a -&gt; m Bool
</span><span class="hs-identifier hs-var">LG.permitItem</span></span><span> </span><span class="annot"><span class="annottext">Severity
</span><span class="hs-identifier hs-var">LG.InfoS</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><span class="hs-identifier hs-var">LG.V2</span></span><span>
</span><span id="line-69"></span><span>    </span><span class="annot"><span class="annottext">Text -&gt; Scribe -&gt; ScribeSettings -&gt; LogContext -&gt; IO LogContext
</span><span class="hs-identifier hs-var">LG.registerScribe</span></span><span> </span><span class="annot"><span class="annottext">Text
</span><span class="hs-string">&quot;stdout&quot;</span></span><span> </span><span class="annot"><span class="annottext">Scribe
</span><a href="#local-6989586621679154267"><span class="hs-identifier hs-var">handleScribe</span></a></span><span> </span><span class="annot"><span class="annottext">ScribeSettings
</span><span class="hs-identifier hs-var">LG.defaultScribeSettings</span></span><span> </span><span class="annot"><span class="annottext">LogContext
</span><a href="#local-6989586621679154266"><span class="hs-identifier hs-var">cxt</span></a></span><span>
</span><span id="line-70"></span><span>
</span><span id="line-71"></span><span class="annot"><span class="hs-comment">-- * stderr logger</span></span><span>
</span><span id="line-72"></span><span>
</span><span id="line-73"></span><span class="annot"><span class="hs-comment">-- | Runs a Katip logging block with the Log environment</span></span><span>
</span><span id="line-74"></span><span class="annot"><a href="OpenAPIPetstore.LoggingKatip.html#stderrLoggingExec"><span class="hs-identifier hs-type">stderrLoggingExec</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="OpenAPIPetstore.LoggingKatip.html#LogExecWithContext"><span class="hs-identifier hs-type">LogExecWithContext</span></a></span><span>
</span><span id="line-75"></span><span id="stderrLoggingExec"><span class="annot"><span class="annottext">stderrLoggingExec :: LogExecWithContext
</span><a href="OpenAPIPetstore.LoggingKatip.html#stderrLoggingExec"><span class="hs-identifier hs-var hs-var">stderrLoggingExec</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LogContext -&gt; LogExec m a
LogExecWithContext
</span><a href="OpenAPIPetstore.LoggingKatip.html#runDefaultLogExecWithContext"><span class="hs-identifier hs-var">runDefaultLogExecWithContext</span></a></span><span>
</span><span id="line-76"></span><span>
</span><span id="line-77"></span><span class="annot"><span class="hs-comment">-- | A Katip Log environment which targets stderr</span></span><span>
</span><span id="line-78"></span><span class="annot"><a href="OpenAPIPetstore.LoggingKatip.html#stderrLoggingContext"><span class="hs-identifier hs-type">stderrLoggingContext</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="OpenAPIPetstore.LoggingKatip.html#LogContext"><span class="hs-identifier hs-type">LogContext</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="OpenAPIPetstore.LoggingKatip.html#LogContext"><span class="hs-identifier hs-type">LogContext</span></a></span><span>
</span><span id="line-79"></span><span id="stderrLoggingContext"><span class="annot"><span class="annottext">stderrLoggingContext :: LogContext -&gt; IO LogContext
</span><a href="OpenAPIPetstore.LoggingKatip.html#stderrLoggingContext"><span class="hs-identifier hs-var hs-var">stderrLoggingContext</span></a></span></span><span> </span><span id="local-6989586621679154281"><span class="annot"><span class="annottext">LogContext
</span><a href="#local-6989586621679154281"><span class="hs-identifier hs-var">cxt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-80"></span><span>    </span><span id="local-6989586621679154282"><span class="annot"><span class="annottext">Scribe
</span><a href="#local-6989586621679154282"><span class="hs-identifier hs-var">handleScribe</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ColorStrategy -&gt; Handle -&gt; PermitFunc -&gt; Verbosity -&gt; IO Scribe
</span><span class="hs-identifier hs-var">LG.mkHandleScribe</span></span><span> </span><span class="annot"><span class="annottext">ColorStrategy
</span><span class="hs-identifier hs-var">LG.ColorIfTerminal</span></span><span> </span><span class="annot"><span class="annottext">Handle
</span><span class="hs-identifier hs-var">IO.stderr</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Severity -&gt; Item a -&gt; IO Bool
forall (m :: * -&gt; *) a. Monad m =&gt; Severity -&gt; Item a -&gt; m Bool
</span><span class="hs-identifier hs-var">LG.permitItem</span></span><span> </span><span class="annot"><span class="annottext">Severity
</span><span class="hs-identifier hs-var">LG.InfoS</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><span class="hs-identifier hs-var">LG.V2</span></span><span>
</span><span id="line-81"></span><span>    </span><span class="annot"><span class="annottext">Text -&gt; Scribe -&gt; ScribeSettings -&gt; LogContext -&gt; IO LogContext
</span><span class="hs-identifier hs-var">LG.registerScribe</span></span><span> </span><span class="annot"><span class="annottext">Text
</span><span class="hs-string">&quot;stderr&quot;</span></span><span> </span><span class="annot"><span class="annottext">Scribe
</span><a href="#local-6989586621679154282"><span class="hs-identifier hs-var">handleScribe</span></a></span><span> </span><span class="annot"><span class="annottext">ScribeSettings
</span><span class="hs-identifier hs-var">LG.defaultScribeSettings</span></span><span> </span><span class="annot"><span class="annottext">LogContext
</span><a href="#local-6989586621679154281"><span class="hs-identifier hs-var">cxt</span></a></span><span>
</span><span id="line-82"></span><span>
</span><span id="line-83"></span><span class="annot"><span class="hs-comment">-- * Null logger</span></span><span>
</span><span id="line-84"></span><span>
</span><span id="line-85"></span><span class="annot"><span class="hs-comment">-- | Disables Katip logging</span></span><span>
</span><span id="line-86"></span><span class="annot"><a href="OpenAPIPetstore.LoggingKatip.html#runNullLogExec"><span class="hs-identifier hs-type">runNullLogExec</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="OpenAPIPetstore.LoggingKatip.html#LogExecWithContext"><span class="hs-identifier hs-type">LogExecWithContext</span></a></span><span>
</span><span id="line-87"></span><span id="runNullLogExec"><span class="annot"><span class="annottext">runNullLogExec :: LogExecWithContext
</span><a href="OpenAPIPetstore.LoggingKatip.html#runNullLogExec"><span class="hs-identifier hs-var hs-var">runNullLogExec</span></a></span></span><span> </span><span id="local-6989586621679154293"><span class="annot"><span class="annottext">LogContext
</span><a href="#local-6989586621679154293"><span class="hs-identifier hs-var">le</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">LG.KatipT</span></span><span> </span><span id="local-6989586621679154295"><span class="annot"><span class="annottext">ReaderT LogContext m a
</span><a href="#local-6989586621679154295"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReaderT LogContext m a -&gt; LogContext -&gt; m a
forall r (m :: * -&gt; *) a. ReaderT r m a -&gt; r -&gt; m a
</span><span class="hs-identifier hs-var">P.runReaderT</span></span><span> </span><span class="annot"><span class="annottext">ReaderT LogContext m a
</span><a href="#local-6989586621679154295"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ASetter
  LogContext
  LogContext
  (Map Text ScribeHandle)
  (Map Text ScribeHandle)
-&gt; Map Text ScribeHandle -&gt; LogContext -&gt; LogContext
forall s t a b. ASetter s t a b -&gt; b -&gt; s -&gt; t
</span><span class="hs-identifier hs-var">L.set</span></span><span> </span><span class="annot"><span class="annottext">ASetter
  LogContext
  LogContext
  (Map Text ScribeHandle)
  (Map Text ScribeHandle)
Lens' LogContext (Map Text ScribeHandle)
</span><span class="hs-identifier hs-var">LG.logEnvScribes</span></span><span> </span><span class="annot"><span class="annottext">Map Text ScribeHandle
forall a. Monoid a =&gt; a
</span><span class="hs-identifier hs-var">mempty</span></span><span> </span><span class="annot"><span class="annottext">LogContext
</span><a href="#local-6989586621679154293"><span class="hs-identifier hs-var">le</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-88"></span><span>
</span><span id="line-89"></span><span class="annot"><span class="hs-comment">-- * Log Msg</span></span><span>
</span><span id="line-90"></span><span>
</span><span id="line-91"></span><span class="annot"><span class="hs-comment">-- | Log a katip message</span></span><span>
</span><span id="line-92"></span><span id="local-6989586621679154209"><span class="annot"><a href="OpenAPIPetstore.LoggingKatip.html#_log"><span class="hs-identifier hs-type">_log</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Applicative</span></span><span> </span><span class="annot"><a href="#local-6989586621679154209"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">LG.Katip</span></span><span> </span><span class="annot"><a href="#local-6989586621679154209"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Text</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="OpenAPIPetstore.LoggingKatip.html#LogLevel"><span class="hs-identifier hs-type">LogLevel</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Text</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679154209"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-93"></span><span id="_log"><span class="annot"><span class="annottext">_log :: forall (m :: * -&gt; *).
(Applicative m, Katip m) =&gt;
Text -&gt; Severity -&gt; Text -&gt; m ()
</span><a href="OpenAPIPetstore.LoggingKatip.html#_log"><span class="hs-identifier hs-var hs-var">_log</span></a></span></span><span> </span><span id="local-6989586621679154307"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679154307"><span class="hs-identifier hs-var">src</span></a></span></span><span> </span><span id="local-6989586621679154308"><span class="annot"><span class="annottext">Severity
</span><a href="#local-6989586621679154308"><span class="hs-identifier hs-var">level</span></a></span></span><span> </span><span id="local-6989586621679154309"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679154309"><span class="hs-identifier hs-var">msg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-94"></span><span>  </span><span class="annot"><span class="annottext">Namespace -&gt; Severity -&gt; LogStr -&gt; m ()
forall (m :: * -&gt; *).
(Applicative m, Katip m) =&gt;
Namespace -&gt; Severity -&gt; LogStr -&gt; m ()
</span><span class="hs-identifier hs-var">LG.logMsg</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Namespace
forall a. IsString a =&gt; String -&gt; a
</span><span class="hs-identifier hs-var">fromString</span></span><span> </span><span class="annot"><span class="annottext">(String -&gt; Namespace) -&gt; String -&gt; Namespace
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><span class="hs-operator hs-var">$</span></span><span> </span><span class="annot"><span class="annottext">Text -&gt; String
</span><span class="hs-identifier hs-var">T.unpack</span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679154307"><span class="hs-identifier hs-var">src</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Severity
</span><a href="#local-6989586621679154308"><span class="hs-identifier hs-var">level</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; LogStr
forall a. StringConv a Text =&gt; a -&gt; LogStr
</span><span class="hs-identifier hs-var">LG.logStr</span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679154309"><span class="hs-identifier hs-var">msg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-95"></span><span>
</span><span id="line-96"></span><span class="annot"><span class="hs-comment">-- * Log Exceptions</span></span><span>
</span><span id="line-97"></span><span>
</span><span id="line-98"></span><span class="annot"><span class="hs-comment">-- | re-throws exceptions after logging them</span></span><span>
</span><span id="line-99"></span><span id="local-6989586621679154220"><span id="local-6989586621679154222"><span class="annot"><a href="OpenAPIPetstore.LoggingKatip.html#logExceptions"><span class="hs-identifier hs-type">logExceptions</span></a></span><span>
</span><span id="line-100"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">LG.Katip</span></span><span> </span><span class="annot"><a href="#local-6989586621679154220"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">E.MonadCatch</span></span><span> </span><span class="annot"><a href="#local-6989586621679154220"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Applicative</span></span><span> </span><span class="annot"><a href="#local-6989586621679154220"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-101"></span><span>  </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Text</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679154220"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679154222"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679154220"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679154222"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-102"></span><span id="logExceptions"><span class="annot"><span class="annottext">logExceptions :: forall (m :: * -&gt; *) a.
(Katip m, MonadCatch m, Applicative m) =&gt;
Text -&gt; m a -&gt; m a
</span><a href="OpenAPIPetstore.LoggingKatip.html#logExceptions"><span class="hs-identifier hs-var hs-var">logExceptions</span></a></span></span><span> </span><span id="local-6989586621679154333"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679154333"><span class="hs-identifier hs-var">src</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-103"></span><span>  </span><span class="annot"><span class="annottext">(SomeException -&gt; m a) -&gt; m a -&gt; m a
forall (m :: * -&gt; *) e a.
(MonadCatch m, Exception e) =&gt;
(e -&gt; m a) -&gt; m a -&gt; m a
</span><span class="hs-identifier hs-var">E.handle</span></span><span>
</span><span id="line-104"></span><span>    </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621679154335"><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679154335"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">E.SomeException</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-105"></span><span>       </span><span class="annot"><span class="annottext">Text -&gt; Severity -&gt; Text -&gt; m ()
forall (m :: * -&gt; *).
(Applicative m, Katip m) =&gt;
Text -&gt; Severity -&gt; Text -&gt; m ()
</span><a href="OpenAPIPetstore.LoggingKatip.html#_log"><span class="hs-identifier hs-var">_log</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679154333"><span class="hs-identifier hs-var">src</span></a></span><span> </span><span class="annot"><span class="annottext">Severity
</span><span class="hs-identifier hs-var">LG.ErrorS</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Text
</span><span class="hs-identifier hs-var">T.pack</span></span><span> </span><span class="annot"><span class="annottext">(String -&gt; Text)
-&gt; (SomeException -&gt; String) -&gt; SomeException -&gt; Text
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><span class="hs-operator hs-var">.</span></span><span> </span><span class="annot"><span class="annottext">SomeException -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><span class="hs-identifier hs-var">show</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679154335"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-106"></span><span>       </span><span class="annot"><span class="annottext">SomeException -&gt; m a
forall (m :: * -&gt; *) e a. (MonadThrow m, Exception e) =&gt; e -&gt; m a
</span><span class="hs-identifier hs-var">E.throw</span></span><span> </span><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679154335"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-107"></span><span>
</span><span id="line-108"></span><span class="annot"><span class="hs-comment">-- * Log Level</span></span><span>
</span><span id="line-109"></span><span>
</span><span id="line-110"></span><span class="annot"><a href="OpenAPIPetstore.LoggingKatip.html#levelInfo"><span class="hs-identifier hs-type">levelInfo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="OpenAPIPetstore.LoggingKatip.html#LogLevel"><span class="hs-identifier hs-type">LogLevel</span></a></span><span>
</span><span id="line-111"></span><span id="levelInfo"><span class="annot"><span class="annottext">levelInfo :: Severity
</span><a href="OpenAPIPetstore.LoggingKatip.html#levelInfo"><span class="hs-identifier hs-var hs-var">levelInfo</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Severity
</span><span class="hs-identifier hs-var">LG.InfoS</span></span><span>
</span><span id="line-112"></span><span>
</span><span id="line-113"></span><span class="annot"><a href="OpenAPIPetstore.LoggingKatip.html#levelError"><span class="hs-identifier hs-type">levelError</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="OpenAPIPetstore.LoggingKatip.html#LogLevel"><span class="hs-identifier hs-type">LogLevel</span></a></span><span>
</span><span id="line-114"></span><span id="levelError"><span class="annot"><span class="annottext">levelError :: Severity
</span><a href="OpenAPIPetstore.LoggingKatip.html#levelError"><span class="hs-identifier hs-var hs-var">levelError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Severity
</span><span class="hs-identifier hs-var">LG.ErrorS</span></span><span>
</span><span id="line-115"></span><span>
</span><span id="line-116"></span><span class="annot"><a href="OpenAPIPetstore.LoggingKatip.html#levelDebug"><span class="hs-identifier hs-type">levelDebug</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="OpenAPIPetstore.LoggingKatip.html#LogLevel"><span class="hs-identifier hs-type">LogLevel</span></a></span><span>
</span><span id="line-117"></span><span id="levelDebug"><span class="annot"><span class="annottext">levelDebug :: Severity
</span><a href="OpenAPIPetstore.LoggingKatip.html#levelDebug"><span class="hs-identifier hs-var hs-var">levelDebug</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Severity
</span><span class="hs-identifier hs-var">LG.DebugS</span></span><span>
</span><span id="line-118"></span></pre></body></html>