mirror of
http://git.carcosa.net/jmcbray/brutaldon.git
synced 2024-11-23 07:13:52 -05:00
Add extra debug logging to production
This commit is contained in:
parent
e63d6b86f5
commit
e05601db22
@ -103,6 +103,58 @@ AUTH_PASSWORD_VALIDATORS = [
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
LOGGING = {
|
||||||
|
'version': 1,
|
||||||
|
'disable_existing_loggers': False,
|
||||||
|
'filters': {
|
||||||
|
'require_debug_false': {
|
||||||
|
'()': 'django.utils.log.RequireDebugFalse',
|
||||||
|
},
|
||||||
|
'require_debug_true': {
|
||||||
|
'()': 'django.utils.log.RequireDebugTrue',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'formatters': {
|
||||||
|
'django.server': {
|
||||||
|
'()': 'django.utils.log.ServerFormatter',
|
||||||
|
'format': '[%(server_time)s] %(message)s',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'handlers': {
|
||||||
|
'console': {
|
||||||
|
'level': 'INFO',
|
||||||
|
'filters': ['require_debug_true'],
|
||||||
|
'class': 'logging.StreamHandler',
|
||||||
|
},
|
||||||
|
'console_debug_false': {
|
||||||
|
'level': 'ERROR',
|
||||||
|
'filters': ['require_debug_false'],
|
||||||
|
'class': 'logging.StreamHandler',
|
||||||
|
},
|
||||||
|
'django.server': {
|
||||||
|
'level': 'INFO',
|
||||||
|
'class': 'logging.StreamHandler',
|
||||||
|
'formatter': 'django.server',
|
||||||
|
},
|
||||||
|
'mail_admins': {
|
||||||
|
'level': 'ERROR',
|
||||||
|
'filters': ['require_debug_false'],
|
||||||
|
'class': 'django.utils.log.AdminEmailHandler'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'loggers': {
|
||||||
|
'django': {
|
||||||
|
'handlers': ['console', 'console_debug_false', 'mail_admins'],
|
||||||
|
'level': 'INFO',
|
||||||
|
},
|
||||||
|
'django.server': {
|
||||||
|
'handlers': ['django.server'],
|
||||||
|
'level': 'INFO',
|
||||||
|
'propagate': False,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# Internationalization
|
# Internationalization
|
||||||
# https://docs.djangoproject.com/en/2.0/topics/i18n/
|
# https://docs.djangoproject.com/en/2.0/topics/i18n/
|
||||||
|
@ -35,7 +35,6 @@ def get_mastodon(request):
|
|||||||
raise NotLoggedInException()
|
raise NotLoggedInException()
|
||||||
if request.session['access_token'] in pool.keys():
|
if request.session['access_token'] in pool.keys():
|
||||||
mastodon = pool[request.session['access_token']]
|
mastodon = pool[request.session['access_token']]
|
||||||
print("Mastodon from pool")
|
|
||||||
else:
|
else:
|
||||||
mastodon = Mastodon(
|
mastodon = Mastodon(
|
||||||
client_id = client.client_id,
|
client_id = client.client_id,
|
||||||
@ -43,7 +42,6 @@ def get_mastodon(request):
|
|||||||
api_base_url = client.api_base_id,
|
api_base_url = client.api_base_id,
|
||||||
access_token = request.session['access_token'],
|
access_token = request.session['access_token'],
|
||||||
ratelimit_method='throw')
|
ratelimit_method='throw')
|
||||||
print("New Mastodon added to pool")
|
|
||||||
pool[request.session['access_token']] = mastodon
|
pool[request.session['access_token']] = mastodon
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
@ -54,7 +52,6 @@ def get_mastodon(request):
|
|||||||
raise NotLoggedInException()
|
raise NotLoggedInException()
|
||||||
if user.access_token in pool.keys():
|
if user.access_token in pool.keys():
|
||||||
mastodon = pool[user.access_token]
|
mastodon = pool[user.access_token]
|
||||||
print("Mastodon from pool")
|
|
||||||
else:
|
else:
|
||||||
mastodon = Mastodon(
|
mastodon = Mastodon(
|
||||||
client_id = client.client_id,
|
client_id = client.client_id,
|
||||||
@ -63,7 +60,6 @@ def get_mastodon(request):
|
|||||||
api_base_url = client.api_base_id,
|
api_base_url = client.api_base_id,
|
||||||
ratelimit_method="throw")
|
ratelimit_method="throw")
|
||||||
print("New Mastodon added to pool")
|
print("New Mastodon added to pool")
|
||||||
pool[user.access_token] = mastodon
|
|
||||||
return mastodon
|
return mastodon
|
||||||
|
|
||||||
def fullbrutalism_p(request):
|
def fullbrutalism_p(request):
|
||||||
|
Loading…
Reference in New Issue
Block a user