Deppie v1.1.2 Deppie View Source

Deppie is a very small library to make logging deprecation warnings easy.

Typically you want to notify the user on first use of a deprecated function, rather than every time they use the function. Deppie makes this easy in an efficient and convenient way - the typical overhead of a Deppie.once/1 call is under a single microsecond.

Link to this section Summary

Functions

Emits a deprecation message the first time this function is called

Emits a deprecation message every time this function is called

Link to this section Functions

Link to this function once(msg) View Source
once(msg :: bitstring()) :: :ok

Emits a deprecation message the first time this function is called.

This makes it easy to log deprecation on first usage, rather than having to check manually.

Examples

iex> Deppie.once("MyModule.my_function/1 is deprecated!")
:ok
Link to this function warn(msg) View Source
warn(msg :: bitstring()) :: :ok

Emits a deprecation message every time this function is called.

This is a less frequent use case, but it’s used internally by Deppie.once/1 to avoid duplication of any log formatting.

Examples

iex> Deppie.warn("MyModule.my_function/1 is deprecated!")
:ok