Make fn/0 that returns given string
import SigilF
Logger.debug(~f"It will be called only when log level is debug #{heavy_func()}")
# it is same as
Logger.debug(fn -> "It will be called only when log level is debug #{heavy_func()}" end)
If available in Hex, the package can be installed
by adding sigil_f
to your list of dependencies in mix.exs
:
def deps do
[
{:sigil_f, "~> 0.1.0"}
]
end
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/sigil_f.