mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Update logging in sandbox code, and log tracebacks as single log messages.
Summary: - Replace logger module by the standard module 'logging'. - When a log message from the sandbox includes newlines (e.g. for tracebacks), keep those lines together in the Node log message. Previously each line was a different message, making it difficult to view tracebacks, particularly in prod where each line becomes a separate message object. - Fix assorted lint errors. Test Plan: Added a test for the log-line splitting and escaping logic. Reviewers: georgegevoian Reviewed By: georgegevoian Differential Revision: https://phab.getgrist.com/D3956
This commit is contained in:
@@ -6,18 +6,6 @@ import re
|
||||
import six
|
||||
|
||||
import actions
|
||||
import logger
|
||||
|
||||
def limit_log_stderr(min_level):
|
||||
"""
|
||||
Returns a log handler suitable for logger.set_handler(), which logs using log_stderr but only
|
||||
messages at the given level or higher.
|
||||
"""
|
||||
def handler(level, name, msg):
|
||||
if level >= min_level:
|
||||
logger.log_stderr(level, name, msg)
|
||||
return handler
|
||||
|
||||
|
||||
def table_data_from_rows(table_id, col_names, rows):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user