comparison MoinMoin/util/abuse.py @ 6076:f4ec84967c27

add colon to make log_attempt even more parseable
author 'Karl O. Pinc' <kop@meme.com>
date Mon, 15 Sep 2014 22:10:45 -0500
parents 3f7f4cef7c2a
children
comparison
equal deleted inserted replaced
6075:3f7f4cef7c2a 6076:f4ec84967c27
29 if request and hasattr(request, 'user') and request.user.valid: 29 if request and hasattr(request, 'user') and request.user.valid:
30 username = request.user.name 30 username = request.user.name
31 else: 31 else:
32 username = u'anonymous' 32 username = u'anonymous'
33 level = (logging.WARNING, logging.INFO)[success] 33 level = (logging.WARNING, logging.INFO)[success]
34 msg = """%s: status %s: username "%s": ip %s: page %s""" 34 msg = """: %s: status %s: username "%s": ip %s: page %s"""
35 status = ("failure", "success")[success] 35 status = ("failure", "success")[success]
36 ip = request and request.remote_addr or 'unknown' 36 ip = request and request.remote_addr or 'unknown'
37 logging.log(level, msg, system, status, username, ip, pagename) 37 logging.log(level, msg, system, status, username, ip, pagename)