flix

0.69.2

Logger

eff LoggerSource

An effect used to log messages.

Operations

def log(s: Severity, m: RichString): Unit \ Logger Source

Logs the given message m at the given severity s.

Definitions

def debug(m: a): Unit \ Logger + Aef[a] with Formattable[a] Source

Logs the message m at the Debug level.

def fatal(m: a): Unit \ Logger + Aef[a] with Formattable[a] Source

Logs the message m at the Fatal level.

def handle(f: a -> b \ ef): a -> b \ (ef - Logger) + IO Source

Handles the Logger effect of the given function f.

In other words, re-interprets the Logger effect using the IO effect.

def handleWithAbort(g: Severity -> (RichString -> Bool \ ef1), f: a -> b \ ef2): a -> b \ ef1 + ef2 + Abort + Logger Source

Aborts with the message m from Logger.log if given function g returns true. Otherwise, lets Logger effect propagate.

def handleWithConsole(f: a -> b \ ef): a -> b \ (ef - Logger) + Console Source

Handles the Logger effect of the given function f.

In other words, re-interprets the Logger effect using the Console effect.

def handleWithFilter(filter: Severity -> (RichString -> Bool \ ef1), f: a -> b \ ef2): a -> b \ (ef2 - Logger) + Logger + ef1 Source

Handles the Logger effect of the given function f.

Filters the logging, by the filter function.

def handleWithList(f: a -> b \ ef): a -> (b, List[(Severity, RichString)]) \ ef - Logger Source

Handles the Logger effect of the given function f.

In other words, returns a list of (Severity, RichString) that represents and is ordered by the calls to log.

def info(m: a): Unit \ Logger + Aef[a] with Formattable[a] Source

Logs the message m at the Info level.

def runWithAbort(g: Severity -> (RichString -> Bool \ ef1), f: Unit -> a \ ef2): a \ ef1 + ef2 + Abort + Logger Source

Aborts with the message m from Logger.log if given function g returns true. Otherwise, lets Logger effect propagate.

def runWithConsole(f: Unit -> a \ ef): a \ (ef - Logger) + Console Source

Runs the Logger effect of the given function f.

In other words, re-interprets the Logger effect using the Console effect.

def runWithFilter(filter: Severity -> (RichString -> Bool \ ef1), f: Unit -> b \ ef2): b \ (ef2 - Logger) + Logger + ef1 Source

Runs the Logger effect of the given function f.

Filters the logging, by the filter function.

@DefaultHandler
def runWithIO(f: Unit -> a \ ef): a \ (ef - Logger) + IO Source

Runs the Logger effect of the given function f.

In other words, re-interprets the Logger effect using the IO effect.

def runWithList(f: Unit -> b \ ef): (b, List[(Severity, RichString)]) \ ef - Logger Source

Runs the Logger effect of the given function f.

In other words, returns a list of (Severity, RichString) that represents and is ordered by the calls to log.

def runWithSeverityFilter(s: Severity, f: Unit -> b \ ef): b \ (ef - Logger) + Logger Source

Filters logs with greater or equal severity level

def trace(m: a): Unit \ Logger + Aef[a] with Formattable[a] Source

Logs the message m at the Trace level.

def warn(m: a): Unit \ Logger + Aef[a] with Formattable[a] Source

Logs the message m at the Warn level.