plone.protect/master: Merge pull request #63 from plone/jone-fix-logging-message

GitHub <jenkins-z4DKO/[email protected]>
Newsgroups gmane.comp.web.zope.plone.cvs
Message-ID <[email protected]>
Repository: plone.protect
Branch: refs/heads/master
Date: 2017-07-08T19:30:38+02:00
Author: Maurits van Rees (mauritsvanrees) <[email protected]>
Commit: https://github.com/plone/plone.protect/commit/05f78ca8993bc612d1e4669c60cd76a3a4ba317d

Merge pull request #63 from plone/jone-fix-logging-message

Fix logging to no longer write to stdout.

Files changed:
M CHANGES.rst
M plone/protect/auto.py

diff --git a/CHANGES.rst b/CHANGES.rst
index c7fd472..af2d932 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -14,7 +14,9 @@ New features:
 
 Bug fixes:
 
-- *add item here*
+- Fix logging to no longer write traceback to stdout, but include it in the
+  logging message instead.
+  [jone]
 
 
 3.0.24 (2017-07-03)
diff --git a/plone/protect/auto.py b/plone/protect/auto.py
index 445aaaf..78e7f20 100644
--- a/plone/protect/auto.py
+++ b/plone/protect/auto.py
@@ -276,7 +276,7 @@ def _check(self):
                     logger.info(
                         '{0:s}\naborting transaction due to no CSRF '
                         'protection on url {1:s}'.format(
-                            traceback.print_stack(),
+                            '\n'.join(traceback.format_stack()),
                             self.request.URL
                         )
                     )



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.