quiet overly verbose logging from smtp and openid, these can be

turned back on via the ini files
This commit is contained in:
Shane Caraveo 2010-11-10 11:10:34 -08:00
Родитель 7fbc52768b
Коммит 4e5962869c
2 изменённых файлов: 14 добавлений и 1 удалений

Просмотреть файл

@ -39,6 +39,7 @@ import gdata.contacts
from pylons import config, request, response, session, tmpl_context as c, url
from pylons.controllers.util import abort, redirect
from paste.deploy.converters import asbool
from linkdrop.lib.oauth.oid_extensions import OAuthRequest
from linkdrop.lib.oauth.oid_extensions import UIRequest
@ -170,7 +171,9 @@ class api():
url = "https://mail.google.com/mail/b/%s/smtp/" % from_
to_ = options['to']
server = SMTP(self.host, self.port)
server.set_debuglevel(True)
# in the app:main set debug = true to enable
if asbool(config.get('debug', False)):
server.set_debuglevel(True)
subject = options.get('subject')

Просмотреть файл

@ -27,6 +27,7 @@ import re
from openid.consumer import consumer
from openid.extensions import ax, sreg, pape
from openid.store import memstore, filestore, sqlstore
from openid import oidutil
from pylons import config, request, response, session, tmpl_context as c, url
from pylons.controllers.util import abort, redirect
@ -35,6 +36,15 @@ from linkdrop.lib.oauth.base import get_oauth_config
log = logging.getLogger(__name__)
# overwrite the openid logger so we can manage what log level is used
# currently openid however does not define a log level, so everything
# goes to debug. if we set our log level in the ini file, we'll get
# openid logging
def openid_logger(message, level=logging.DEBUG):
log.debug(message)
oidutil.log = openid_logger
__all__ = ['OpenIDResponder']