Received: from mail.netlandish.com (unknown [10.138.202.29]) by code.netlandish.com (Postfix) with ESMTP id EDC4980CCF for <~petersanchez/public-inbox@lists.code.netlandish.com>; Thu, 10 Dec 2020 14:16:54 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.128.48; helo=mail-wm1-f48.google.com; envelope-from=hugo@yunojuno.com; receiver= Authentication-Results: mail.netlandish.com; dkim=pass (2048-bit key; unprotected) header.d=yunojuno-com.20150623.gappssmtp.com header.i=@yunojuno-com.20150623.gappssmtp.com header.b=ZrvC6+AK Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by mail.netlandish.com (Postfix) with ESMTP id 34D6675375 for <~petersanchez/public-inbox@lists.code.netlandish.com>; Thu, 10 Dec 2020 06:16:54 -0800 (PST) Received: by mail-wm1-f48.google.com with SMTP id k10so4800460wmi.3 for <~petersanchez/public-inbox@lists.code.netlandish.com>; Thu, 10 Dec 2020 06:16:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yunojuno-com.20150623.gappssmtp.com; s=20150623; h=mime-version:content-transfer-encoding:subject:message-id :user-agent:date:from:to:cc; bh=txGvy9XuWHZn4cjvgQF2RyaftmTquUEOF8CFlfH61DE=; b=ZrvC6+AKM3wBdDpQYFmiM5En4tG5YPRqsQ1YBhIOz4wSwPQefDVyHhEJq/w0q1S3zD 8KMiuI2xr6sI/Ij0DBuv9Q3CxSKuBqYYKhIWwR4XJlK5IbdQ2O67LegDmeB0ly5CAoCY yBwrFX1VqXpMOHNgHEnwe7R2nhs5AM42O36F/4sR6B31o/E1tTxCPQG2vAsLe7Vj58Dp 78XVxqUvU6n+6Y5jJAmFHkPevS2AsvwMzdXlmYNtIhDFunHxdID+KFeD4uGTxpxWd7G/ 7aN5GtQSaxCrfwERCE0zH6FoUhtk3k2ufQJGiricCg3nGB1RGyeBrzmMj9gj9nGm5D8Q ecxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:content-transfer-encoding:subject :message-id:user-agent:date:from:to:cc; bh=txGvy9XuWHZn4cjvgQF2RyaftmTquUEOF8CFlfH61DE=; b=ji5Fni8nb37xOGAMs7YNi2wiInGuPQNsYWWRBJBBToK7DyCkisUv16XLbRchzWk46I bBd4l/SoGjCKMiPrIaiZp43rpS6Gfk2XG9Ne1+qpRaFFdWeGzmcZZU4Jvj2/5qKXEKgn uRU2pbVLdbu/J7yE/xy3ID7j1jMe8ynXeQ7lp1bOz5+zIoFyPFm55O6mQdJZQ5iDT/Hd Q/c2neYZ0F68degbSRrad9aNllg2cK617xueRsPxg7bVW7H44Bt0tJumhxbttLSAKi05 h+fNwBeOM8azWEe0pQEre2YMfZ2zUnYefeOrh65veyoEOA0J/dojCqc7Zo2W3SXuMA4Z M1hQ== X-Gm-Message-State: AOAM531mVIfQPGbMlkyf39loTJPZv+zEucOZkwvGtCguX3xeL1zRBhKi WbzoGm4uqGNGO2LN9q+Zo26b+GGwBx963tNJbrY= X-Google-Smtp-Source: ABdhPJwYTHaB93+jL858AeLENm3I2Q++EU44hc6EkepFeR71rXl60zJIabDfhBvX5CPLa/eSDyDMKw== X-Received: by 2002:a1c:3c4:: with SMTP id 187mr8282114wmd.143.1607609812712; Thu, 10 Dec 2020 06:16:52 -0800 (PST) Received: from [127.0.0.1] ([217.138.171.195]) by smtp.gmail.com with ESMTPSA id b9sm9448638wmd.32.2020.12.10.06.16.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Dec 2020 06:16:51 -0800 (PST) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH django-impersonate] Downgrade signals logging from warning to debug X-Mercurial-Node: bd1429321fb4a7f4627448681d369d07875c5edf X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 1 Message-Id: X-Mercurial-Series-Id: User-Agent: Mercurial-patchbomb/5.6.1 Date: Thu, 10 Dec 2020 14:16:46 +0000 From: Hugo Rodger-Brown To: ~petersanchez/public-inbox@lists.code.netlandish.com Cc: hugo@yunojuno.com # HG changeset patch # User Hugo Rodger-Brown # Date 1607608487 0 # Thu Dec 10 13:54:47 2020 +0000 # Branch downgrade-logging # Node ID bd1429321fb4a7f4627448681d369d07875c5edf # Parent a174b1c67a73699e1ea51d1433db7d0f22c4e6ef Downgrade signals logging from warning to debug In production we are seeing the warnings raised by the signals appearing frequently. I believe this is caused by people having multiple tabs open, stopping impersonating in one, and then some time later clicking the stop impersonate link in another. This is a completely valid use case, and shouldn't raise a warning. diff --git a/impersonate/signals.py b/impersonate/signals.py --- a/impersonate/signals.py +++ b/impersonate/signals.py @@ -87,7 +87,7 @@ log.session_ended_at = tz_now() log.save() except ImpersonationLog.DoesNotExist: - logger.warning( + logger.debug( (u'Unfinished ImpersonationLog could not be found for: ' u'{0}, {1}, {2}').format( impersonator, @@ -96,7 +96,7 @@ ) ) except ImpersonationLog.MultipleObjectsReturned: - logger.warning( + logger.debug( (u'Multiple unfinished ImpersonationLog matching: ' u'{0}, {1}, {2}').format( impersonator,