DiscoLog (disco_log v2.0.0-rc.1)
View SourceSend messages to Discord
All functions in this module accept optional context and config parameters.
contextis the last opportunity to assign some metadata that will be attached to the message or occurrence. Occurrences will additionally be tagged if context key names match existing channel tags.configis important if you're running advanced configuration
Summary
Functions
Sends text message to the channel configures as error_channel_id
Sends text message to the channel configured as info_channel_id
Report catched error to occurrences channel
Functions
@spec log_error(String.t(), DiscoLog.Context.t(), DiscoLog.Config.t() | nil) :: DiscoLog.Discord.API.response()
Sends text message to the channel configures as error_channel_id
@spec log_info(String.t(), DiscoLog.Context.t(), DiscoLog.Config.t() | nil) :: DiscoLog.Discord.API.response()
Sends text message to the channel configured as info_channel_id
@spec report( Exception.kind(), any(), Exception.stacktrace(), DiscoLog.Context.t(), DiscoLog.Config.t() | nil ) :: DiscoLog.Discord.API.response()
Report catched error to occurrences channel
This function reports an error directly to the occurrences channel, bypassing logging.
Example:
try do
raise "Unexpected!"
catch
kind, reason -> DiscoLog.report(kind, reason, __STACKTRACE__)
end