本文整理匯總了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)