server_utils v0.1.5 ServerUtils.Logger

Logger wrapper that handles warn and error logging and sends a Sentry report. Both logging and Sentry calls will be executed asynchronously.

Sentry will need to be configured in the project that uses this dependency.

The integration with Sentry can be disabled by setting the system variable DISABLE_SENTRY as true.

Link to this section Summary

Functions

Logs a debug message

Logs a error message

Logs a info message

Logs a warn message

Link to this section Functions

Link to this function debug(message)
debug(String.t()) :: atom()

Logs a debug message.

Returns :ok or an {:error, reason} tuple.

Link to this function error(message)
error(String.t()) :: atom() | Task.t()

Logs a error message.

Unless the system variable DISABLE_SENTRY is set, it will send the logged message as error level to Sentry.

Returns :ok or an {:error, reason} tuple if Sentry is disabled.

Returns a Task struct is Sentry is enabled.

Link to this function info(message)
info(String.t()) :: atom()

Logs a info message.

Returns :ok or an {:error, reason} tuple.

Link to this function warn(message)
warn(String.t()) :: atom() | Task.t()

Logs a warn message.

Unless the system variable DISABLE_SENTRY is set, it will send the logged message as warning level to Sentry.

Returns :ok or an {:error, reason} tuple.

Returns a Task struct is Sentry is enabled.