View Source DiscoLog.Config (disco_log v1.0.0-rc.2)

DiscoLog configuration

Configuration Schema

  • :otp_app (atom/0) - Required. Name of your application

  • :token (String.t/0) - Required. Your Discord bot token

  • :guild_id (String.t/0) - Required. Discord Server ID

  • :category_id (String.t/0) - Required. Category (Channel) ID

  • :occurrences_channel_id (String.t/0) - Required. Forum channel ID for error occurrences

  • :info_channel_id (String.t/0) - Required. Text channel ID for info-level logs

  • :error_channel_id (String.t/0) - Required. Text channel ID for logs higher than info-level logs

  • :enable (boolean/0) - Automatically start DiscoLog? The default value is true.

  • :enable_logger (boolean/0) - Automatically attach logger handler? The default value is true.

  • :enable_discord_log (boolean/0) - Log requests to Discord API? The default value is false.

  • :enable_presence (boolean/0) - Show DiscoLog bot status as Online? The default value is false.

  • :instrument_oban (boolean/0) - Automatically instrument Oban? The default value is true.

  • :instrument_phoenix (boolean/0) - Automatically instrument Phoenix? The default value is true.

  • :instrument_tesla (boolean/0) - Automatically instrument Tesla? The default value is true.

  • :metadata (list of atom/0) - List of Logger metadata keys to propagate with the message The default value is [].

  • :excluded_domains (list of atom/0) - Logs with domains from this list will be ignored The default value is [:cowboy, :bandit].

  • :discord_client_module (atom/0) - Discord client to use The default value is DiscoLog.Discord.API.Client.

  • :supervisor_name (atom/0) - Name of the supervisor process running DiscoLog The default value is DiscoLog.

  • :presence_status (String.t/0) - A message to display as the bot's status when presence is enabled The default value is "🪩 Disco Logging".

  • :enable_go_to_repo (boolean/0) - Enable go_to_repo feature? The default value is false.

  • :go_to_repo_top_modules (list of String.t/0) - List of top-level modules that are not part of the application spec but code belongs to the app The default value is [].

  • :repo_url (String.t/0) - URL to the git repository viewer The default value is "".

  • :git_sha (String.t/0) - The git SHA of the running app The default value is "".

Summary

Functions

Reads and validates config from global application configuration

Validates configuration against the schema

Types

config()

@type config() :: map()

Functions

read!()

@spec read!() :: config()

Reads and validates config from global application configuration

validate(config)

@spec validate(options :: keyword() | map()) ::
  {:ok, config()} | {:error, NimbleOptions.ValidationError.t()}

Validates configuration against the schema

validate!(options)

@spec validate!(options :: keyword() | map()) :: config()

See validate/1