flix

0.72.0

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 handleWithFileWrite(file: String, f: a -> b \ ef): a -> b \ (ef - Logger) + FileWrite Source

Handles the Logger effect of the given function f. Appends the logged to file.

Discards style from the logged messages. Ignores errors encountered while writing.

def handleWithFileWriteAbort(file: String, f: a -> b \ ef): a -> b \ (ef - Logger) + FileWrite + Abort Source

Handles the Logger effect of the given function f. Appends the logged to file.

Discards style from the logged messages. Aborts if an error is encountered while writing to file.

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 handleWithStdErr(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.

Prints to standard error.

def handleWithStdOut(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.

Prints to standard out.

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 runWithFileWrite(file: String, f: Unit -> a \ ef): a \ (ef - Logger) + FileWrite Source

Runs the Logger effect of the given function f. Appends the logged to file.

Discards style from the logged messages. Ignores errors encountered while writing.

def runWithFileWriteAbort(file: String, f: Unit -> a \ ef): a \ (ef - Logger) + FileWrite + Abort Source

Runs the Logger effect of the given function f. Appends the logged to file.

Discards style from the logged messages. Aborts if an error is encountered while writing to file.

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 runWithStdErr(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.

Prints to standard error.

def runWithStdOut(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.

Prints to standard out.

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.