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:
@@ -1,13 +1,13 @@
|
||||
from collections import namedtuple
|
||||
import json
|
||||
import logging
|
||||
|
||||
import six
|
||||
|
||||
from column import is_visible_column
|
||||
import sort_specs
|
||||
|
||||
import logger
|
||||
log = logger.Logger(__name__, logger.INFO)
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
ColInfo = namedtuple('ColInfo', ('colId', 'type', 'isFormula', 'formula',
|
||||
'widgetOptions', 'label'))
|
||||
@@ -134,7 +134,7 @@ def _update_sort_spec(sort_spec, old_table, new_table):
|
||||
new_sort_spec = [col_spec for col_spec in new_sort_spec if sort_specs.col_ref(col_spec)]
|
||||
return json.dumps(new_sort_spec, separators=(',', ':'))
|
||||
except Exception:
|
||||
log.warn("update_summary_section: can't parse sortColRefs JSON; clearing sortColRefs")
|
||||
log.warning("update_summary_section: can't parse sortColRefs JSON; clearing sortColRefs")
|
||||
return ''
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user