DiscoLog.Config (disco_log v2.0.0-rc.1)

View Source

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.

  • :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 [].

  • :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

supervisor_name()

@type supervisor_name() :: atom()

t()

@type t() :: %{
  otp_app: atom(),
  token: String.t(),
  guild_id: String.t(),
  category_id: String.t(),
  occurrences_channel_id: String.t(),
  info_channel_id: String.t(),
  error_channel_id: String.t(),
  enable: boolean(),
  enable_logger: boolean(),
  enable_discord_log: boolean(),
  enable_presence: boolean(),
  instrument_oban: boolean(),
  metadata: [atom()],
  excluded_domains: [atom()],
  discord_client_module: module(),
  supervisor_name: supervisor_name(),
  presence_status: String.t(),
  enable_go_to_repo: boolean(),
  go_to_repo_top_modules: [module()],
  repo_url: String.t(),
  git_sha: String.t(),
  discord_client: DiscoLog.Discord.API.t(),
  in_app_modules: [module()]
}

Functions

read!()

@spec read!() :: t()

Reads and validates config from global application configuration

validate(config)

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

Validates configuration against the schema

validate!(options)

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

See validate/1