Coverage for bookie.lib.applog : 85%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
""" Handle application logging items
Current db model:
id, user, component, status, message, payload, tstamp
"""
"""Log handler"""
# status levels
def store(status, message, **kwargs): """Store a log item"""
"""Store auth specific log items"""
"""Store that a user logged into the system"""
success)
'user': username, 'component': AuthLog.component, 'payload': passwd(password) }
def disabled(username): """Attempt to log into a disabled account"""
'user': username, 'component': AuthLog.component }
"""The account was marked for reactivation""" else: msg = "{0} attempted to reactivate with invalid credentials" msg = msg.format(username)
'user': username, 'component': AuthLog.component, 'payload': { 'success': success, 'code': code, } }
"""Bookmark specific log items"""
def export(for_user, current_user): """Note that a user has exported their bookmarks"""
elif current_user is None: current_user = "None"
current_user, for_user)
'user': current_user, 'component': BmarkLog.component, }
"""A record in the log"""
"""A record in the log"""
# we need to hash down the payload if there is one
"""Signup Log records."""
"""A record in the log""" kwargs['status'] = status kwargs['message'] = message
# we need to hash down the payload if there is one if 'payload' in kwargs and kwargs['payload'] is not None: kwargs['payload'] = json.dumps(dict(kwargs.get('payload')))
AppLogMgr.store(**kwargs) |