LogVol (log_vol v0.0.1)

Documentation for LogVol, a wrapper around Elixir's native Logger with global volume control.

Link to this section Summary

Functions

Logs the debug message at the currently set volume. If a message is not specified at a volume, nothing will be displayed if debug is called at that volume.

See docs for debug/1.

Logs the error message at the currently set volume. If a message is not specified at a volume, nothing will be displayed if error is called at that volume.

See docs for error/1.

Logs the info message at the currently set volume. If a message is not specified at a volume, nothing will be displayed if info is called at that volume.

See docs for info/1.

Sets the logging volume for the application. There are 5 supported log volumes

Returns the currently set logging volume for the application.

Logs the warn message at the currently set volume. If a message is not specified at a volume, nothing will be displayed if warn is called at that volume.

See docs for warn/1.

Link to this section Functions

Link to this function

debug(string_or_keyword)

Logs the debug message at the currently set volume. If a message is not specified at a volume, nothing will be displayed if debug is called at that volume.

Usage

For convenience, debug/1 can be given a string to log at :normal volume or a keyword list of strings to log at any volume. debug/2 takes a string to log at :normal volume and a keyword list of strings to log at other volumes.

Examples

iex> LogVol.volume
:normal
iex> LogVol.debug("normal msg")
timestamp [debug] normal msg
:ok
iex> LogVol.set :verbose
:ok
iex> LogVol.debug("normal msg", verbose: "verbose msg")
:noop
iex> LogVol.debug(verbose: "verbose msg")
timestamp [debug] verbose msg
:ok
iex> LogVol.debug(very_verbose: "very verbose msg")
:noop
iex> LogVol.debug("normal msg")
:noop
Link to this function

debug(string, options)

See docs for debug/1.

Link to this function

error(string_or_keyword)

Logs the error message at the currently set volume. If a message is not specified at a volume, nothing will be displayed if error is called at that volume.

Usage

For convenience, error/1 can be given a string to log at :normal volume or a keyword list of strings to log at any volume. error/2 takes a string to log at :normal volume and a keyword list of strings to log at other volumes.

Examples

iex> LogVol.volume
:normal
iex> LogVol.error("normal msg")
timestamp [error] normal msg
:ok
iex> LogVol.set :verbose
:ok
iex> LogVol.error("normal msg", verbose: "verbose msg")
:noop
iex> LogVol.error(verbose: "verbose msg")
timestamp [error] verbose msg
:ok
iex> LogVol.error(very_verbose: "very verbose msg")
:noop
iex> LogVol.error("normal msg")
:noop
Link to this function

error(string, options)

See docs for error/1.

Link to this function

info(string_or_keyword)

Logs the info message at the currently set volume. If a message is not specified at a volume, nothing will be displayed if info is called at that volume.

Usage

For convenience, info/1 can be given a string to log at :normal volume or a keyword list of strings to log at any volume. info/2 takes a string to log at :normal volume and a keyword list of strings to log at other volumes.

Examples

iex> LogVol.volume
:normal
iex> LogVol.info("normal msg")
timestamp [info] normal msg
:ok
iex> LogVol.set :verbose
:ok
iex> LogVol.info("normal msg", verbose: "verbose msg")
:noop
iex> LogVol.info(verbose: "verbose msg")
timestamp [info] verbose msg
:ok
iex> LogVol.info(very_verbose: "very verbose msg")
:noop
iex> LogVol.info("normal msg")
:noop
Link to this function

info(string, options)

See docs for info/1.

Sets the logging volume for the application. There are 5 supported log volumes:

:very_verbose
:verbose
:normal
:quiet
:silent

Returns :ok if successful, else {:error, reason}.

Returns the currently set logging volume for the application.

Examples

iex> LogVol.volume
:normal
Link to this function

warn(string_or_keyword)

Logs the warn message at the currently set volume. If a message is not specified at a volume, nothing will be displayed if warn is called at that volume.

Usage

For convenience, warn/1 can be given a string to log at :normal volume or a keyword list of strings to log at any volume. warn/2 takes a string to log at :normal volume and a keyword list of strings to log at other volumes.

Examples

iex> LogVol.volume
:normal
iex> LogVol.warn("normal msg")
timestamp [warn] normal msg
:ok
iex> LogVol.set :verbose
:ok
iex> LogVol.warn("normal msg", verbose: "verbose msg")
:noop
iex> LogVol.warn(verbose: "verbose msg")
timestamp [warn] verbose msg
:ok
iex> LogVol.warn(very_verbose: "very verbose msg")
:noop
iex> LogVol.warn("normal msg")
:noop
Link to this function

warn(string, options)

See docs for warn/1.