premailer: replace logger instead of altering handlers.
Initial logger posted to stderr poluting output and tests
This commit is contained in:
parent
f56bc796ad
commit
59792e6457
1 changed files with 6 additions and 5 deletions
|
|
@ -330,6 +330,11 @@ EMAIL_COMMENT_STATUS_CHANGE_SUBJECT_TEMPLATE = ''
|
|||
# Title of email for inline comment on a file in commit
|
||||
EMAIL_COMMENT_FILE_SUBJECT_TEMPLATE = ''
|
||||
|
||||
import cssutils
|
||||
# hijack css utils logger and replace with ours
|
||||
log = logging.getLogger('rhodecode.cssutils.premailer')
|
||||
cssutils.log.setLog(log)
|
||||
|
||||
|
||||
class EmailNotificationModel(BaseModel):
|
||||
TYPE_COMMIT_COMMENT = Notification.TYPE_CHANGESET_COMMENT
|
||||
|
|
@ -373,11 +378,7 @@ class EmailNotificationModel(BaseModel):
|
|||
'rhodecode:templates/email_templates/pull_request_update.mako',
|
||||
}
|
||||
|
||||
premailer_instance = premailer.Premailer(
|
||||
cssutils_logging_level=logging.ERROR,
|
||||
cssutils_logging_handler=logging.getLogger().handlers[0]
|
||||
if logging.getLogger().handlers else None,
|
||||
)
|
||||
premailer_instance = premailer.Premailer()
|
||||
|
||||
def __init__(self):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue