def _handle_logging(self, level, message):
"""
Handles an RPC logging request.
:param str level: One of "debug", "info", "warning", or "error".
:param str message: The log message.
"""
# manually create a record to log to the standard file handler.
# we format it to match the regular logs, but tack on the '.js' to
# indicate that it came from javascript.
record = logging.makeLogRecord({
"levelname": level.upper(),
"name": "%s.js" % (self.logger.name,),
"msg": message,
})
# forward this message to the base file handler so that it is logged
# appropriately.
if sgtk.LogManager().base_file_handler:
sgtk.LogManager().base_file_handler.handle(record)
评论列表
文章目录