0001-misc-don-t-use-quixote-code-to-send-traceback-emails.patch
wcs/qommon/logger.py | ||
---|---|---|
18 | 18 |
import os |
19 | 19 | |
20 | 20 |
from quixote import get_publisher, get_session, get_request |
21 |
from quixote.logger import DefaultLogger |
|
22 | ||
23 | ||
24 |
class ApplicationLogger(DefaultLogger): |
|
25 |
def log_internal_error(self, error_summary, error_msg): |
|
26 |
self.log('exception caught') |
|
27 |
self.error_log.write(error_msg) |
|
28 |
if self.error_email: |
|
29 |
from .emails import email |
|
30 |
email(subject='Quixote Traceback (%s)' % error_summary, |
|
31 |
mail_body=error_msg, |
|
32 |
email_rcpt=[self.error_email], |
|
33 |
want_html=False, |
|
34 |
fire_and_forget=True) |
|
21 | 35 | |
22 | 36 | |
23 | 37 |
class BotFilter(logging.Filter): |
wcs/qommon/publisher.py | ||
---|---|---|
730 | 730 |
@classmethod |
731 | 731 |
def create_publisher(cls, **kwargs): |
732 | 732 |
publisher = cls(cls.root_directory_class(), |
733 |
session_cookie_name = cls.APP_NAME,
|
|
734 |
session_cookie_path = '/',
|
|
735 |
error_log = cls.ERROR_LOG)
|
|
733 |
session_cookie_name=cls.APP_NAME,
|
|
734 |
session_cookie_path='/',
|
|
735 |
logger=logger.ApplicationLogger(error_log=cls.ERROR_LOG))
|
|
736 | 736 |
publisher.substitutions = Substitutions() |
737 | 737 |
publisher.app_dir = cls.APP_DIR |
738 | 738 |
publisher.data_dir = cls.DATA_DIR |
739 |
- |