Commit 1fc63c74 authored by Vidjil Team's avatar Vidjil Team
Browse files logging, reverse-ip with prefixes

parent 310ee623
......@@ -249,9 +249,11 @@ class MsgUserAdapter(logging.LoggerAdapter):
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
Supports Markdown
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