Commit 1fc63c74 authored by Vidjil Team's avatar Vidjil Team
Browse files

db.py: logging, reverse-ip with prefixes

parent 310ee623
......@@ -249,9 +249,11 @@ class MsgUserAdapter(logging.LoggerAdapter):
else:
msg = '?'
ip = request.client
if ip in ips:
ip = "%s/%s" % (ip, ips[ip])
new_msg = '%15s <%s> %s' % (ip, (auth.user.first_name if auth.user else ''), msg)
if ip:
for ip_prefix in ips:
if ip.startswith(ip_prefix):
ip = "%s/%s" % (ip, ips[ip_prefix])
new_msg = '%30s %12s %s' % (ip, ('<%s>' % auth.user.first_name if auth.user else ''), msg)
return new_msg, kwargs
#
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment