mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-23 18:04:34 +00:00
logging_json: fix RecursionError
Since Python 3.10, the use of 'threading.currentThread()' is deprecated and generates a warning, and generating this warning log was in turn entering in the `logging_json` mechanism, triggering an exception: RecursionError: maximum recursion depth exceeded while calling a Python object
This commit is contained in:
committed by
cyrilmanuel
co-authored by
cyrilmanuel
parent
99e6785179
commit
f34dc6be27
@@ -26,7 +26,7 @@ def is_true(strval):
|
||||
class OdooJsonFormatter(jsonlogger.JsonFormatter):
|
||||
def add_fields(self, log_record, record, message_dict):
|
||||
record.pid = os.getpid()
|
||||
record.dbname = getattr(threading.currentThread(), "dbname", "?")
|
||||
record.dbname = getattr(threading.current_thread(), "dbname", "?")
|
||||
record.request_id = getattr(threading.current_thread(), "request_uuid", None)
|
||||
record.uid = getattr(threading.current_thread(), "uid", None)
|
||||
_super = super(OdooJsonFormatter, self)
|
||||
|
||||
Reference in New Issue
Block a user