本文整理汇总了Python中sorl.thumbnail.log.ThumbnailLogHandler.setLevel方法的典型用法代码示例。如果您正苦于以下问题:Python ThumbnailLogHandler.setLevel方法的具体用法?Python ThumbnailLogHandler.setLevel怎么用?Python ThumbnailLogHandler.setLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sorl.thumbnail.log.ThumbnailLogHandler
的用法示例。
在下文中一共展示了ThumbnailLogHandler.setLevel方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ThumbnailLogHandler
# 需要导入模块: from sorl.thumbnail.log import ThumbnailLogHandler [as 别名]
# 或者: from sorl.thumbnail.log.ThumbnailLogHandler import setLevel [as 别名]
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'blog',
'sorl.thumbnail',
'ckeditor',
'location_field',
'cart',
)
THUMBNAIL_DEBUG = True
import logging
from sorl.thumbnail.log import ThumbnailLogHandler
handler = ThumbnailLogHandler()
handler.setLevel(logging.DEBUG)
logging.getLogger('sorl.thumbnail').addHandler(handler)
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware',
)
ROOT_URLCONF = 'mysite.urls'
示例2: ThumbnailLogHandler
# 需要导入模块: from sorl.thumbnail.log import ThumbnailLogHandler [as 别名]
# 或者: from sorl.thumbnail.log.ThumbnailLogHandler import setLevel [as 别名]
import logging
from sorl.thumbnail.log import ThumbnailLogHandler
handler = ThumbnailLogHandler()
handler.setLevel(logging.ERROR)
logging.getLogger('sorl.thumbnail').addHandler(handler)
示例3: ThumbnailLogHandler
# 需要导入模块: from sorl.thumbnail.log import ThumbnailLogHandler [as 别名]
# 或者: from sorl.thumbnail.log.ThumbnailLogHandler import setLevel [as 别名]
import logging
from sorl.thumbnail.log import ThumbnailLogHandler
handler = ThumbnailLogHandler()
handler.setLevel(logging.INFO)
logging.getLogger('sorl.thumbnail').addHandler(handler)