diff --git a/lib/federation/activity_pub/activity_pub.ex b/lib/federation/activity_pub/activity_pub.ex index a2852aa44..12ab02376 100644 --- a/lib/federation/activity_pub/activity_pub.ex +++ b/lib/federation/activity_pub/activity_pub.ex @@ -70,7 +70,7 @@ defmodule Mobilizon.Federation.ActivityPub do handle_existing_entity(url, entity, options) {:error, e} -> - Logger.warn("Something failed while fetching url #{url} #{inspect(e)}") + Logger.warning("Something failed while fetching url #{url} #{inspect(e)}") {:error, e} end else diff --git a/lib/federation/activity_pub/fetcher.ex b/lib/federation/activity_pub/fetcher.ex index af519ab59..1ffc008ab 100644 --- a/lib/federation/activity_pub/fetcher.ex +++ b/lib/federation/activity_pub/fetcher.ex @@ -65,7 +65,7 @@ defmodule Mobilizon.Federation.ActivityPub.Fetcher do {:error, :transmogrifier_error} end else - Logger.warn("Object origin check failed") + Logger.warning("Object origin check failed") {:error, :object_origin_check_failed} end @@ -89,7 +89,7 @@ defmodule Mobilizon.Federation.ActivityPub.Fetcher do "object" => data }) else - Logger.warn("Object origin check failed") + Logger.warning("Object origin check failed") {:error, :object_origin_check_failed} end diff --git a/lib/federation/activity_pub/permission.ex b/lib/federation/activity_pub/permission.ex index 7e78b317c..9c8628797 100644 --- a/lib/federation/activity_pub/permission.ex +++ b/lib/federation/activity_pub/permission.ex @@ -89,13 +89,13 @@ defmodule Mobilizon.Federation.ActivityPub.Permission do _ -> case permission do :access -> - Logger.warn("Actor #{actor_url} can't access #{object.url}") + Logger.warning("Actor #{actor_url} can't access #{object.url}") :update -> - Logger.warn("Actor #{actor_url} can't update #{object.url}") + Logger.warning("Actor #{actor_url} can't update #{object.url}") :delete -> - Logger.warn("Actor #{actor_url} can't delete #{object.url}") + Logger.warning("Actor #{actor_url} can't delete #{object.url}") end false diff --git a/lib/federation/activity_pub/relay.ex b/lib/federation/activity_pub/relay.ex index 9091ce30f..a45635cec 100644 --- a/lib/federation/activity_pub/relay.ex +++ b/lib/federation/activity_pub/relay.ex @@ -56,11 +56,11 @@ defmodule Mobilizon.Federation.ActivityPub.Relay do {:ok, activity, follow} else {:error, :person_no_follow} -> - Logger.warn("Only group and instances can be followed") + Logger.warning("Only group and instances can be followed") {:error, :person_no_follow} {:error, e} -> - Logger.warn("Error while following remote instance: #{inspect(e)}") + Logger.warning("Error while following remote instance: #{inspect(e)}") {:error, e} end end @@ -78,7 +78,7 @@ defmodule Mobilizon.Federation.ActivityPub.Relay do {:ok, activity, follow} else {:error, e} -> - Logger.warn("Error while unfollowing remote instance: #{inspect(e)}") + Logger.warning("Error while unfollowing remote instance: #{inspect(e)}") {:error, e} end end @@ -96,7 +96,7 @@ defmodule Mobilizon.Federation.ActivityPub.Relay do {:ok, activity, follow} else {:error, e} -> - Logger.warn("Error while accepting remote instance follow: #{inspect(e)}") + Logger.warning("Error while accepting remote instance follow: #{inspect(e)}") {:error, e} end end @@ -114,7 +114,7 @@ defmodule Mobilizon.Federation.ActivityPub.Relay do {:ok, activity, follow} else {:error, e} -> - Logger.warn("Error while rejecting remote instance follow: #{inspect(e)}") + Logger.warning("Error while rejecting remote instance follow: #{inspect(e)}") {:error, e} end end @@ -137,7 +137,7 @@ defmodule Mobilizon.Federation.ActivityPub.Relay do }) else {:error, e} -> - Logger.warn("Error while refreshing remote instance: #{inspect(e)}") + Logger.warning("Error while refreshing remote instance: #{inspect(e)}") {:error, e} end end diff --git a/lib/federation/activity_pub/transmogrifier.ex b/lib/federation/activity_pub/transmogrifier.ex index 9348bb80b..dc8457961 100644 --- a/lib/federation/activity_pub/transmogrifier.ex +++ b/lib/federation/activity_pub/transmogrifier.ex @@ -203,7 +203,7 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier do Actions.Delete.delete(entity, Relay.get_actor(), false) {:error, err} -> - Logger.warn("Error while fetching object from URL: #{inspect(err)}") + Logger.warning("Error while fetching object from URL: #{inspect(err)}") :error end end @@ -219,11 +219,11 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier do {:ok, activity, object} else {:error, :person_no_follow} -> - Logger.warn("Only group and instances can be followed") + Logger.warning("Only group and instances can be followed") :error {:error, e} -> - Logger.warn("Unable to handle Follow activity #{inspect(e)}") + Logger.warning("Unable to handle Follow activity #{inspect(e)}") :error end end @@ -325,14 +325,14 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier do :error {:object_not_found, nil} -> - Logger.warn( + Logger.warning( "Unable to process Accept activity #{inspect(id)}. Object #{inspect(accepted_object)} wasn't found." ) :error e -> - Logger.warn( + Logger.warning( "Unable to process Accept activity #{inspect(id)} for object #{inspect(accepted_object)} only returned #{inspect(e)}" ) @@ -353,14 +353,14 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier do {:ok, activity, object} else {:object_not_found, nil} -> - Logger.warn( + Logger.warning( "Unable to process Reject activity #{inspect(id)}. Object #{inspect(rejected_object)} wasn't found." ) :error e -> - Logger.warn( + Logger.warning( "Unable to process Reject activity #{inspect(id)} for object #{inspect(rejected_object)} only returned #{inspect(e)}" ) @@ -405,7 +405,7 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier do {:ok, activity, new_actor} else {:error, :update_not_allowed} -> - Logger.warn( + Logger.warning( "Activity tried to update an actor that's local or not a group: #{inspect(params)}" ) @@ -485,7 +485,7 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier do {:ok, activity, new_post} else {:origin_check, _} -> - Logger.warn("Actor tried to update a post but doesn't has the required role") + Logger.warning("Actor tried to update a post but doesn't has the required role") :error _e -> @@ -692,7 +692,7 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier do {:ok, activity, object} else {:only_organizer, true} -> - Logger.warn( + Logger.warning( "Actor #{inspect(actor)} tried to leave event #{inspect(object)} but it was the only organizer so we didn't detach it" ) @@ -742,14 +742,14 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier do Actions.Remove.remove(member, group, moderator, false) else {:is_admin, {:ok, %Member{}}} -> - Logger.warn( + Logger.warning( "Person #{inspect(actor)} is not an admin from #{inspect(origin)} and can't remove member #{inspect(object)}" ) {:error, "Member already removed"} {:is_member, {:ok, %Member{role: :rejected}}} -> - Logger.warn("Member #{inspect(object)} already removed from #{inspect(origin)}") + Logger.warning("Member #{inspect(object)} already removed from #{inspect(origin)}") {:error, "Member already removed"} end end @@ -949,7 +949,7 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier do {:ok, activity, participant} else {:join_event, {:ok, _activity, %Participant{role: :rejected}}} -> - Logger.warn( + Logger.warning( "Tried to handle an Reject activity on a Join activity with a event object but the participant is already rejected" ) @@ -1100,7 +1100,7 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier do {:ok, object} err -> - Logger.warn("Error while fetching #{inspect(object)}") + Logger.warning("Error while fetching #{inspect(object)}") {:error, err} end end @@ -1242,7 +1242,7 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier do Permission.can_delete_group_object?(actor, entity) do Actions.Delete.delete(entity, actor, false) else - Logger.warn("Object origin check failed") + Logger.warning("Object origin check failed") :error end diff --git a/lib/federation/activity_stream/converter/comment.ex b/lib/federation/activity_stream/converter/comment.ex index 77a02daf6..9fb98823c 100644 --- a/lib/federation/activity_stream/converter/comment.ex +++ b/lib/federation/activity_stream/converter/comment.ex @@ -202,7 +202,7 @@ defmodule Mobilizon.Federation.ActivityStream.Converter.Comment do # Anything else is kind of a MP {:error, parent} -> - Logger.warn("Parent object is something we don't handle") + Logger.warning("Parent object is something we don't handle") Logger.debug(inspect(parent)) data end diff --git a/lib/graphql/api/reports.ex b/lib/graphql/api/reports.ex index 561e269b5..d4467791c 100644 --- a/lib/graphql/api/reports.ex +++ b/lib/graphql/api/reports.ex @@ -57,7 +57,7 @@ defmodule Mobilizon.GraphQL.API.Reports do end if antispam_response != :ok do - Logger.warn("Antispam response has been #{inspect(antispam_response)}") + Logger.warning("Antispam response has been #{inspect(antispam_response)}") end {:ok, report} diff --git a/lib/graphql/error.ex b/lib/graphql/error.ex index 09b22a001..6223fd509 100644 --- a/lib/graphql/error.ex +++ b/lib/graphql/error.ex @@ -123,7 +123,7 @@ defmodule Mobilizon.GraphQL.Error do defp metadata(:unknown), do: {500, dgettext("errors", "Something went wrong")} defp metadata(code) do - Logger.warn("Unhandled error code: #{inspect(code)}") + Logger.warning("Unhandled error code: #{inspect(code)}") {422, to_string(code)} end diff --git a/lib/mix/tasks/mobilizon/actors/refresh.ex b/lib/mix/tasks/mobilizon/actors/refresh.ex index aafbfe22d..29249ef4d 100644 --- a/lib/mix/tasks/mobilizon/actors/refresh.ex +++ b/lib/mix/tasks/mobilizon/actors/refresh.ex @@ -87,7 +87,7 @@ defmodule Mix.Tasks.Mobilizon.Actors.Refresh do rescue _ -> if verbose do - Logger.warn("Failed to refresh #{username}") + Logger.warning("Failed to refresh #{username}") end nil diff --git a/lib/service/git_status.ex b/lib/service/git_status.ex index 92cc8eff1..a114bc431 100644 --- a/lib/service/git_status.ex +++ b/lib/service/git_status.ex @@ -10,7 +10,7 @@ defmodule Mobilizon.Service.GitStatus do _ -> # Fallback on Mix version - Logger.warn("Could not read git commit hash, using Mix version code instead.") + Logger.warning("Could not read git commit hash, using Mix version code instead.") Mix.Project.config()[:version] end) diff --git a/lib/service/notifier/email.ex b/lib/service/notifier/email.ex index 86027b631..acd213d2e 100644 --- a/lib/service/notifier/email.ex +++ b/lib/service/notifier/email.ex @@ -95,7 +95,7 @@ defmodule Mobilizon.Service.Notifier.Email do end defp can_send_activity?(activity, user, options) do - Logger.warn( + Logger.warning( "Can't check if user #{inspect(user)} can be sent an activity (#{inspect(activity)}) (#{inspect(options)})" ) diff --git a/lib/web/auth/guardian.ex b/lib/web/auth/guardian.ex index d840adc1e..6675dba4a 100644 --- a/lib/web/auth/guardian.ex +++ b/lib/web/auth/guardian.ex @@ -44,7 +44,7 @@ defmodule Mobilizon.Web.Auth.Guardian do end rescue e in Ecto.NoResultsError -> - Logger.warn("Received token claim for non existing user: #{inspect(e)}") + Logger.warning("Received token claim for non existing user: #{inspect(e)}") {:error, :no_result} end end diff --git a/lib/web/controllers/auth_controller.ex b/lib/web/controllers/auth_controller.ex index 2f743d774..6c9c5081b 100644 --- a/lib/web/controllers/auth_controller.ex +++ b/lib/web/controllers/auth_controller.ex @@ -33,7 +33,7 @@ defmodule Mobilizon.Web.AuthController do %{assigns: %{ueberauth_failure: fails}} = conn, %{"provider" => provider} = _params ) do - Logger.warn("Unable to login user with #{provider} #{inspect(fails)}") + Logger.warning("Unable to login user with #{provider} #{inspect(fails)}") redirect_to_error(conn, :unknown_error, provider) end @@ -75,7 +75,7 @@ defmodule Mobilizon.Web.AuthController do }) else err -> - Logger.warn("Unable to login user \"#{email}\" #{inspect(err)}") + Logger.warning("Unable to login user \"#{email}\" #{inspect(err)}") redirect_to_error(conn, :unknown_error, strategy) end end diff --git a/lib/web/controllers/feed_controller.ex b/lib/web/controllers/feed_controller.ex index 7b103f7c3..7def12059 100644 --- a/lib/web/controllers/feed_controller.ex +++ b/lib/web/controllers/feed_controller.ex @@ -65,7 +65,7 @@ defmodule Mobilizon.Web.FeedController do {:error, :not_found} err -> - Logger.warn("Unable to find feed data cached for key #{key}, returned #{inspect(err)}") + Logger.warning("Unable to find feed data cached for key #{key}, returned #{inspect(err)}") {:error, :not_found} end end @@ -89,7 +89,7 @@ defmodule Mobilizon.Web.FeedController do {:error, :not_found} err -> - Logger.warn("Unable to find feed data cached for key #{key}, returned #{inspect(err)}") + Logger.warning("Unable to find feed data cached for key #{key}, returned #{inspect(err)}") {:error, :not_found} end end diff --git a/lib/web/email/group.ex b/lib/web/email/group.ex index b4e5b03be..7423df301 100644 --- a/lib/web/email/group.ex +++ b/lib/web/email/group.ex @@ -70,7 +70,7 @@ defmodule Mobilizon.Web.Email.Group do %Actor{type: :Group, preferred_username: group_username}, user ) do - Logger.warn( + Logger.warning( "Unable to notify group follower user #{user.email} for event #{event_uuid} from group #{group_username}" ) diff --git a/lib/web/proxy/reverse_proxy.ex b/lib/web/proxy/reverse_proxy.ex index 940ae9e16..8a78ef277 100644 --- a/lib/web/proxy/reverse_proxy.ex +++ b/lib/web/proxy/reverse_proxy.ex @@ -126,7 +126,7 @@ defmodule Mobilizon.Web.ReverseProxy do |> halt() {:is_url, false} -> - Logger.warn("Tried to reverse proxy URL #{inspect(url)}") + Logger.warning("Tried to reverse proxy URL #{inspect(url)}") conn |> error_or_redirect(url, 400, "Request failed", opts) @@ -202,7 +202,7 @@ defmodule Mobilizon.Web.ReverseProxy do halt(conn) {:error, error, conn} -> - Logger.warn( + Logger.warning( "#{__MODULE__} request to #{url} failed while reading/chunking: #{inspect(error)}" ) diff --git a/lib/web/templates/email/actor_suspension_participants.text.eex b/lib/web/templates/email/actor_suspension_participants.text.eex index 6274d7b59..a319bab19 100644 --- a/lib/web/templates/email/actor_suspension_participants.text.eex +++ b/lib/web/templates/email/actor_suspension_participants.text.eex @@ -1,3 +1,3 @@ <%= gettext "Your participation to %{event} on %{instance} has been cancelled!", event: @event.title, instance: @instance_name %> == -<%= gettext "Your instance's moderation team has decided to suspend %{actor_name} (%{actor_address}). All of their events have been removed and your participation to event %{event} cancelled.", actor_name: @actor.name || @actor.preferred_username, event: @event.title, actor_address: if @actor.domain, do: "@#{@actor.preferred_username}@#{@actor.domain}", else: "@#{@actor.preferred_username}" %> +<%= gettext "Your instance's moderation team has decided to suspend %{actor_name} (%{actor_address}). All of their events have been removed and your participation to event %{event} cancelled.", actor_name: @actor.name || @actor.preferred_username, event: @event.title, actor_address: preferred_username_and_domain(@actor) %> diff --git a/lib/web/templates/email/group_suspension.text.eex b/lib/web/templates/email/group_suspension.text.eex index 13b72f201..ef74c48b6 100644 --- a/lib/web/templates/email/group_suspension.text.eex +++ b/lib/web/templates/email/group_suspension.text.eex @@ -1,6 +1,6 @@ <%= gettext "The group %{group} has been suspended on %{instance}!", group: (@group.name || @group.preferred_username), instance: @instance_name %> == -<%= gettext "Your instance's moderation team has decided to suspend %{group_name} (%{group_address}). You are no longer a member of this group.", group_name: @group.name, group_address: if @group.domain, do: "@#{@group.preferred_username}@#{@group.domain}", else: "@#{@group.preferred_username}" %> +<%= gettext "Your instance's moderation team has decided to suspend %{group_name} (%{group_address}). You are no longer a member of this group.", group_name: @group.name, group_address: preferred_username_and_domain(@group) %> <%= if is_nil(@group.domain) do %> <%= gettext "As this group was located on this instance, all of it's data has been irretrievably deleted." %> <% else %> diff --git a/lib/web/upload/filter/analyze_metadata.ex b/lib/web/upload/filter/analyze_metadata.ex index e644fd991..6a7c17280 100644 --- a/lib/web/upload/filter/analyze_metadata.ex +++ b/lib/web/upload/filter/analyze_metadata.ex @@ -25,7 +25,7 @@ defmodule Mobilizon.Web.Upload.Filter.AnalyzeMetadata do rescue e in ErlangError -> require Logger - Logger.warn("#{__MODULE__}: #{inspect(e)}") + Logger.warning("#{__MODULE__}: #{inspect(e)}") {:ok, :noop} end diff --git a/lib/web/upload/filter/blurhash.ex b/lib/web/upload/filter/blurhash.ex index 892b811dc..ec7ae05cf 100644 --- a/lib/web/upload/filter/blurhash.ex +++ b/lib/web/upload/filter/blurhash.ex @@ -15,7 +15,7 @@ defmodule Mobilizon.Web.Upload.Filter.BlurHash do {:ok, :filtered, %Upload{upload | blurhash: generate_blurhash(file)}} rescue e in ErlangError -> - Logger.warn("#{__MODULE__}: #{inspect(e)}") + Logger.warning("#{__MODULE__}: #{inspect(e)}") {:ok, :noop} end diff --git a/lib/web/upload/filter/optimize.ex b/lib/web/upload/filter/optimize.ex index e32ff84ca..67e42a5ed 100644 --- a/lib/web/upload/filter/optimize.ex +++ b/lib/web/upload/filter/optimize.ex @@ -28,11 +28,11 @@ defmodule Mobilizon.Web.Upload.Filter.Optimize do {:ok, :filtered} {:error, :file_not_found} -> - Logger.warn("Unable to optimize file #{file}. File was not found") + Logger.warning("Unable to optimize file #{file}. File was not found") {:error, :file_not_found} {:error, err} -> - Logger.warn( + Logger.warning( "Unable to optimize file #{file}. The return from the process was #{inspect(err)}" ) diff --git a/lib/web/views/error_view.ex b/lib/web/views/error_view.ex index 73d5eec8a..6907b6ddb 100644 --- a/lib/web/views/error_view.ex +++ b/lib/web/views/error_view.ex @@ -70,7 +70,7 @@ defmodule Mobilizon.Web.ErrorView do # template is found, let's render it as 500 def template_not_found(template, assigns) do require Logger - Logger.warn("Template #{inspect(template)} not found") + Logger.warning("Template #{inspect(template)} not found") render("500.html", assigns) end end