Commit 06102f4b authored by Mathieu Giraud's avatar Mathieu Giraud Committed by Vidjil

models/VidjilAuth.py, models/db.py: logs messages from web2py Auth()

See #2936.
parent 9e5577e8
......@@ -27,6 +27,7 @@ class VidjilAuth(Auth):
permissions = {}
def __init__(self, environment=None, db=None):
self.log = None
super(VidjilAuth, self).__init__(environment, db)
def preload(self):
......@@ -611,5 +612,9 @@ class VidjilAuth(Auth):
._select(permission.record_id))
return query
def log_event(self, description, vars=None, origin='auth'):
if self.log:
self.log.info('%s %s' % (description, vars))
def __str__():
return "%4s – %s %s" % (self.id, self.first_name, self.last_name)
......@@ -371,6 +371,7 @@ def _init_log():
log = _init_log()
auth.log = log
auth.preload()
current.log = log
......
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