mirror of
https://github.com/evennia/evennia.git
synced 2026-04-04 23:17:17 +02:00
Made lockhandler write lockwarnings to separate log file
This commit is contained in:
parent
f49f33d40d
commit
a143733ccf
2 changed files with 8 additions and 12 deletions
|
|
@ -113,6 +113,7 @@ from django.utils.translation import ugettext as _
|
|||
|
||||
__all__ = ("LockHandler", "LockException")
|
||||
|
||||
WARNING_LOG = "lockwarnings.log"
|
||||
|
||||
#
|
||||
# Exception class. This will be raised
|
||||
|
|
@ -232,12 +233,12 @@ class LockHandler(object):
|
|||
continue
|
||||
if access_type in locks:
|
||||
duplicates += 1
|
||||
wlist.append(_("Lock: access type '%(access_type)s' changed from '%(source)s' to '%(goal)s' " % \
|
||||
{"access_type":access_type, "source":locks[access_type][2], "goal":raw_lockstring}))
|
||||
wlist.append(_("LockHandler on %(obj)s: access type '%(access_type)s' changed from '%(source)s' to '%(goal)s' " % \
|
||||
{"obj":self.obj, "access_type":access_type, "source":locks[access_type][2], "goal":raw_lockstring}))
|
||||
locks[access_type] = (evalstring, tuple(lock_funcs), raw_lockstring)
|
||||
if wlist:
|
||||
# a warning text was set, it's not an error, so only report
|
||||
logger.log_warn("\n".join(wlist))
|
||||
logger.log_file("\n".join(wlist), WARNING_LOG)
|
||||
if elist:
|
||||
# an error text was set, raise exception.
|
||||
raise LockException("\n".join(elist))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue