FStrings.Logger (F-strings v0.1.0)

View Source

Simple Logger wrapper to help using the FStrings library for logs.

Use it like this:

  iex> use FStrings.Logger
  iex> abc = 42
  iex> Logger.info(~f"This is the meaning of life #{abc}=")
  # Will log an info message: "This is the meaning of life 'abc'='42'"

Summary

Functions

A wrapper around Logger.error/2 to be able to use the F-string interpolation without having to specify the ~f"..." sigil.

A wrapper around Logger.info/2 to be able to use the F-string interpolation without having to specify the ~f"..." sigil.

A wrapper around Logger.warning/2 to be able to use the F-string interpolation without having to specify the ~f"..." sigil.

Functions

error(message_or_fun, metadata \\ [])

(macro)

A wrapper around Logger.error/2 to be able to use the F-string interpolation without having to specify the ~f"..." sigil.

Accepts the exact same arguments. Check Logger.error/2 docs for more info.

info(message_or_fun, metadata \\ [])

(macro)

A wrapper around Logger.info/2 to be able to use the F-string interpolation without having to specify the ~f"..." sigil.

Accepts the exact same arguments. Check Logger.info/2 docs for more info.

warning(message_or_fun, metadata \\ [])

(macro)

A wrapper around Logger.warning/2 to be able to use the F-string interpolation without having to specify the ~f"..." sigil.

Accepts the exact same arguments. Check Logger.warning/2 docs for more info.