logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma
commit: 9b97b023c53b88f4c04aed17e36022201016b6c9
parent: ec831751004e024aeff48f2afdbd4b90bc43e8e8
Author: lambda <pleromagit@rogerbraun.net>
Date:   Tue, 20 Mar 2018 05:57:47 +0000

Merge branch 'feld-Logger' into 'develop'

Logging cleanup

See merge request pleroma/pleroma!76

Diffstat:

Mlib/pleroma/user.ex2+-
Mlib/pleroma/web/activity_pub/activity_pub.ex4++--
Mlib/pleroma/web/activity_pub/activity_pub_controller.ex4++--
Mlib/pleroma/web/federator/federator.ex10+++++-----
Mlib/pleroma/web/http_signatures/http_signatures.ex2+-
Mlib/pleroma/web/oauth/authorization.ex4++--
Mlib/pleroma/web/ostatus/ostatus.ex4++--
Mlib/pleroma/web/salmon/salmon.ex4++--
Mlib/pleroma/web/web_finger/web_finger.ex4++--
Mlib/pleroma/web/websub/websub.ex2+-
Mlib/pleroma/web/websub/websub_controller.ex2+-
Mlib/pleroma/web/xml/xml.ex2+-
12 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex @@ -417,7 +417,7 @@ defmodule Pleroma.User do _ -> case OStatus.make_user(ap_id) do {:ok, user} -> user - _ -> {:error, "Could not fetch by ap id"} + _ -> {:error, "Could not fetch by AP id"} end end end diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -301,7 +301,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do {:ok, data} <- Poison.decode(body) do user_data_from_user_object(data) else - e -> Logger.error("Could not user at fetch #{ap_id}, #{inspect(e)}") + e -> Logger.error("Could not decode user at fetch #{ap_id}, #{inspect(e)}") end end @@ -321,7 +321,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do with {:ok, %{"ap_id" => ap_id}} when not is_nil(ap_id) <- WebFinger.finger(nickname) do make_user_from_ap_id(ap_id) else - _e -> {:error, "No ap id in webfinger"} + _e -> {:error, "No AP id in WebFinger"} end end diff --git a/lib/pleroma/web/activity_pub/activity_pub_controller.ex b/lib/pleroma/web/activity_pub/activity_pub_controller.ex @@ -36,9 +36,9 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubController do def inbox(conn, params) do headers = Enum.into(conn.req_headers, %{}) if !(String.contains?(headers["signature"] || "", params["actor"])) do - Logger.info("Signature not from author, relayed message, ignoring.") + Logger.info("Signature not from author, relayed message, ignoring") else - Logger.info("Signature error.") + Logger.info("Signature error") Logger.info("Could not validate #{params["actor"]}") Logger.info(inspect(conn.req_headers)) end diff --git a/lib/pleroma/web/federator/federator.ex b/lib/pleroma/web/federator/federator.ex @@ -48,10 +48,10 @@ defmodule Pleroma.Web.Federator do with actor when not is_nil(actor) <- User.get_cached_by_ap_id(activity.data["actor"]) do {:ok, actor} = WebFinger.ensure_keys_present(actor) if ActivityPub.is_public?(activity) do - Logger.info(fn -> "Sending #{activity.data["id"]} out via websub" end) + Logger.info(fn -> "Sending #{activity.data["id"]} out via WebSub" end) Websub.publish(Pleroma.Web.OStatus.feed_path(actor), actor, activity) - Logger.info(fn -> "Sending #{activity.data["id"]} out via salmon" end) + Logger.info(fn -> "Sending #{activity.data["id"]} out via Salmon" end) Pleroma.Web.Salmon.publish(actor, activity) end @@ -61,7 +61,7 @@ defmodule Pleroma.Web.Federator do end def handle(:verify_websub, websub) do - Logger.debug(fn -> "Running websub verification for #{websub.id} (#{websub.topic}, #{websub.callback})" end) + Logger.debug(fn -> "Running WebSub verification for #{websub.id} (#{websub.topic}, #{websub.callback})" end) @websub.verify(websub) end @@ -71,7 +71,7 @@ defmodule Pleroma.Web.Federator do end def handle(:incoming_ap_doc, params) do - Logger.info("Handling incoming ap activity") + Logger.info("Handling incoming AP activity") with {:ok, _user} <- ap_enabled_actor(params["actor"]), nil <- Activity.get_by_ap_id(params["id"]), {:ok, activity} <- Transmogrifier.handle_incoming(params) do @@ -105,7 +105,7 @@ defmodule Pleroma.Web.Federator do def handle(type, _) do Logger.debug(fn -> "Unknown task: #{type}" end) - {:error, "Don't know what do do with this"} + {:error, "Don't know what to do with this"} end def enqueue(type, payload, priority \\ 1) do diff --git a/lib/pleroma/web/http_signatures/http_signatures.ex b/lib/pleroma/web/http_signatures/http_signatures.ex @@ -36,7 +36,7 @@ defmodule Pleroma.Web.HTTPSignatures do if validate_conn(conn, public_key) do true else - Logger.debug("Could not validate, re-fetching user and trying one more time.") + Logger.debug("Could not validate, re-fetching user and trying one more time") # Fetch user anew and try one more time with actor_id <- conn.params["actor"], {:ok, _user} <- ActivityPub.make_user_from_ap_id(actor_id), diff --git a/lib/pleroma/web/oauth/authorization.ex b/lib/pleroma/web/oauth/authorization.ex @@ -40,8 +40,8 @@ defmodule Pleroma.Web.OAuth.Authorization do if NaiveDateTime.diff(NaiveDateTime.utc_now, valid_until) < 0 do Repo.update(use_changeset(auth, %{used: true})) else - {:error, "token expired"} + {:error, "Token expired"} end end - def use_token(%Authorization{used: true}), do: {:error, "already used"} + def use_token(%Authorization{used: true}), do: {:error, "Already used"} end diff --git a/lib/pleroma/web/ostatus/ostatus.ex b/lib/pleroma/web/ostatus/ostatus.ex @@ -291,8 +291,8 @@ defmodule Pleroma.Web.OStatus do [[_, match]] = Regex.scan(@gs_classic_regex, body) {:ok, match} true -> - Logger.debug(fn -> "Couldn't find atom link in #{inspect(body)}" end) - {:error, "Couldn't find the atom link"} + Logger.debug(fn -> "Couldn't find Atom link in #{inspect(body)}" end) + {:error, "Couldn't find the Atom link"} end end diff --git a/lib/pleroma/web/salmon/salmon.ex b/lib/pleroma/web/salmon/salmon.ex @@ -150,7 +150,7 @@ defmodule Pleroma.Web.Salmon do with {:ok, %{status_code: code}} <- poster.(salmon, feed, [{"Content-Type", "application/magic-envelope+xml"}], timeout: 10000, recv_timeout: 20000, hackney: [pool: :default]) do Logger.debug(fn -> "Pushed to #{salmon}, code #{code}" end) else - e -> Logger.debug(fn -> "Pushing salmon to #{salmon} failed, #{inspect(e)}" end) + e -> Logger.debug(fn -> "Pushing Salmon to #{salmon} failed, #{inspect(e)}" end) end end @@ -178,7 +178,7 @@ defmodule Pleroma.Web.Salmon do remote_users(activity) |> Enum.each(fn(remote_user) -> Task.start(fn -> - Logger.debug(fn -> "sending salmon to #{remote_user.ap_id}" end) + Logger.debug(fn -> "Sending Salmon to #{remote_user.ap_id}" end) send_to_user(remote_user, feed, poster) end) end) diff --git a/lib/pleroma/web/web_finger/web_finger.ex b/lib/pleroma/web/web_finger/web_finger.ex @@ -100,7 +100,7 @@ defmodule Pleroma.Web.WebFinger do with {:ok, %{body: body}} <- @httpoison.get("https://#{domain}/.well-known/host-meta", []) do get_template_from_xml(body) else - e -> {:error, "Can't find lrdd template: #{inspect(e)}"} + e -> {:error, "Can't find LRDD template: #{inspect(e)}"} end end end @@ -122,7 +122,7 @@ defmodule Pleroma.Web.WebFinger do {:ok, data} else e -> - Logger.debug(fn -> "Couldn't finger #{account}." end) + Logger.debug(fn -> "Couldn't finger #{account}" end) Logger.debug(fn -> inspect(e) end) {:error, e} end diff --git a/lib/pleroma/web/websub/websub.ex b/lib/pleroma/web/websub/websub.ex @@ -98,7 +98,7 @@ defmodule Pleroma.Web.Websub do {:ok, websub} else {:error, reason} -> - Logger.debug("Couldn't create subscription.") + Logger.debug("Couldn't create subscription") Logger.debug(inspect(reason)) {:error, reason} diff --git a/lib/pleroma/web/websub/websub_controller.ex b/lib/pleroma/web/websub/websub_controller.ex @@ -20,7 +20,7 @@ defmodule Pleroma.Web.Websub.WebsubController do # TODO: Extract this into the Websub module def websub_subscription_confirmation(conn, %{"id" => id, "hub.mode" => "subscribe", "hub.challenge" => challenge, "hub.topic" => topic} = params) do - Logger.debug("Got websub confirmation") + Logger.debug("Got WebSub confirmation") Logger.debug(inspect(params)) lease_seconds = if params["hub.lease_seconds"] do String.to_integer(params["hub.lease_seconds"]) diff --git a/lib/pleroma/web/xml/xml.ex b/lib/pleroma/web/xml/xml.ex @@ -21,7 +21,7 @@ defmodule Pleroma.Web.XML do doc catch :exit, _error -> - Logger.debug("Couldn't parse xml: #{inspect(text)}") + Logger.debug("Couldn't parse XML: #{inspect(text)}") :error end end