mirror of
https://github.com/TheRealOwenRees/plantid-discord-bot.git
synced 2026-07-22 20:16:57 +00:00
dev env error log to console included metadata
This commit is contained in:
@@ -8,4 +8,5 @@ config :plantid_discord_bot, :environment, :dev
|
||||
|
||||
config :logger, :console,
|
||||
format: "$time $metadata[$level] $message\n",
|
||||
metadata: [:guild_id, :guild_name],
|
||||
level: :debug
|
||||
|
||||
+1
-2
@@ -2,6 +2,5 @@ defmodule PlantIdDiscordBotTest.Mocks.Guild do
|
||||
@moduledoc """
|
||||
Mocks the Guild module.
|
||||
"""
|
||||
def get_guild_name!(guild_id),
|
||||
do: %{guild_id: 1_002_507_312_159_797_318, guild_name: "Test Guild"}
|
||||
def get_guild_name!(_), do: "Test Guild"
|
||||
end
|
||||
|
||||
@@ -3,9 +3,7 @@ defmodule PlantIdDiscordBot.Cog.PlantNetMessage do
|
||||
|
||||
use Nostrum.Consumer
|
||||
alias Nostrum.Api
|
||||
alias PlantIdDiscordBot.{Guild, RateLimiter, Metrics}
|
||||
alias PlantIdDiscordBot.FileServer.File
|
||||
alias PlantIdDiscordBot.PlantNet.Parser
|
||||
alias PlantIdDiscordBot.{Guild, RateLimiter, Metrics, FileServer.File, PlantNet.Parser}
|
||||
|
||||
# TODO reintroduce mocks
|
||||
# @api Application.compile_env(:plantid_discord_bot, :api)
|
||||
@@ -83,7 +81,7 @@ defmodule PlantIdDiscordBot.Cog.PlantNetMessage do
|
||||
|
||||
defp get_response(query_uri, message) do
|
||||
guild_id = message.guild_id
|
||||
guild_name = get_guild_name!(guild_id)
|
||||
guild_name = Guild.get_guild_name!(guild_id)
|
||||
|
||||
case HTTPoison.get(query_uri) do
|
||||
{:ok, %HTTPoison.Response{status_code: 200, body: body}} ->
|
||||
|
||||
Reference in New Issue
Block a user