- info: Lake.LogLevel
- warning: Lake.LogLevel
- error: Lake.LogLevel
Instances For
- quiet: Lake.Verbosity
- normal: Lake.Verbosity
- verbose: Lake.Verbosity
Instances For
Equations
- Lake.instBEqVerbosity = { beq := Lake.beqVerbosity✝ }
Equations
- Lake.instInhabitedVerbosity = { default := Lake.Verbosity.normal }
Class #
- getVerbosity : m Lake.Verbosity
- log : String → Lake.LogLevel → m PUnit
Instances
@[inline]
Equations
- Lake.getIsVerbose = Lake.getVerbosity <&> fun (x : Lake.Verbosity) => x == Lake.Verbosity.verbose
Instances For
@[inline]
Equations
- Lake.getIsQuiet = Lake.getVerbosity <&> fun (x : Lake.Verbosity) => x == Lake.Verbosity.quiet
Instances For
@[inline]
Equations
- Lake.logVerbose message = do let __do_lift ← Lake.getIsVerbose if __do_lift = true then Lake.log message Lake.LogLevel.info else pure PUnit.unit
Instances For
@[inline]
Equations
- Lake.logInfo message = do let __do_lift ← Lake.getIsQuiet if (!__do_lift) = true then Lake.log message Lake.LogLevel.info else pure PUnit.unit
Instances For
@[specialize #[]]
Equations
- Lake.MonadLog.nop = { getVerbosity := pure Lake.Verbosity.normal, log := fun (x : String) (x : Lake.LogLevel) => pure () }
Instances For
Equations
- Lake.MonadLog.instInhabitedMonadLog = { default := Lake.MonadLog.nop }
@[specialize #[]]
def
Lake.MonadLog.io
{m : Type → Type u_1}
[MonadLiftT BaseIO m]
(verbosity : optParam Lake.Verbosity Lake.Verbosity.normal)
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[specialize #[]]
def
Lake.MonadLog.eio
{m : Type → Type u_1}
[MonadLiftT BaseIO m]
(verbosity : optParam Lake.Verbosity Lake.Verbosity.normal)
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[specialize #[]]
def
Lake.MonadLog.lift
{m : Type u_1 → Type u_2}
{n : Type u_1 → Type u_3}
[MonadLiftT m n]
(self : Lake.MonadLog m)
:
Equations
- Lake.MonadLog.lift self = { getVerbosity := liftM Lake.getVerbosity, log := fun (msg : String) (lv : Lake.LogLevel) => liftM (Lake.log msg lv) }
Instances For
instance
Lake.MonadLog.instMonadLog
{m : Type u_1 → Type u_2}
{n : Type u_1 → Type u_3}
[MonadLift m n]
[methods : Lake.MonadLog m]
:
Equations
- Lake.MonadLog.instMonadLog = Lake.MonadLog.lift methods
@[inline]
def
Lake.MonadLog.error
{m : Type u_1 → Type u_2}
{α : Type u_1}
[Alternative m]
[Lake.MonadLog m]
(msg : String)
:
m α
Log the given error message and then fail.
Equations
- Lake.MonadLog.error msg = SeqRight.seqRight (Lake.logError msg) fun (x : Unit) => failure
Instances For
Transformers #
instance
Lake.instInhabitedMonadLogT
{n : Type u_1 → Type u_2}
{α : Type u_1}
{m : Type u_3 → Type u_1}
[Pure n]
[Inhabited α]
:
Inhabited (Lake.MonadLogT m n α)
Equations
- Lake.instInhabitedMonadLogT = { default := fun (x : Lake.MonadLog m) => pure default }
instance
Lake.instMonadLogMonadLogT
{n : Type u_1 → Type u_2}
{m : Type u_1 → Type u_1}
[Monad n]
[MonadLiftT m n]
:
Lake.MonadLog (Lake.MonadLogT m n)
Equations
- One or more equations did not get rendered due to their size.
@[inline]
def
Lake.MonadLogT.adaptMethods
{n : Type u_1 → Type u_2}
{m : Type u_3 → Type u_1}
{m' : Type u_4 → Type u_1}
{α : Type u_1}
[Monad n]
(f : Lake.MonadLog m → Lake.MonadLog m')
(self : Lake.MonadLogT m' n α)
:
Lake.MonadLogT m n α
Equations
- Lake.MonadLogT.adaptMethods f self = ReaderT.adapt f self
Instances For
@[inline]
def
Lake.MonadLogT.ignoreLog
{m : Type → Type u_1}
{n : Type u_1 → Type u_2}
{α : Type u_1}
[Pure m]
(self : Lake.MonadLogT m n α)
:
n α
Equations
- Lake.MonadLogT.ignoreLog self = self Lake.MonadLog.nop
Instances For
@[inline, reducible]
Equations
Instances For
Equations
- Lake.instMonadErrorLogIO = { error := fun {α : Type} => Lake.MonadLog.error }
Equations
- Lake.instMonadLiftIOLogIO = { monadLift := fun {α : Type} => Lake.MonadError.runIO }
def
Lake.LogIO.captureLog
{α : Type}
(self : Lake.LogIO α)
(verbosity : optParam Lake.Verbosity Lake.Verbosity.normal)
:
Equations
- Lake.LogIO.captureLog self verbosity = IO.FS.withIsolatedStreams (Lake.OptionIO.toBaseIO (self (Lake.MonadLog.eio verbosity)))