(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:
Dmitry S
2023-07-18 11:20:02 -04:00
parent 7fd48364df
commit 534615dd50
46 changed files with 154 additions and 249 deletions

View File

@@ -14,6 +14,7 @@ from imports import import_utils
log = logging.getLogger(__name__)
log.setLevel(logging.WARNING)
SCHEMA = [
{

View File

@@ -4,16 +4,17 @@ and returns a object formatted so that it can be used by grist for a bulk add re
"""
import logging
import six
import openpyxl
from openpyxl.utils.datetime import from_excel
from openpyxl.worksheet import _reader
from openpyxl.worksheet import _reader # pylint:disable=no-name-in-module
import six
from six.moves import zip
import parse_data
from imports import import_utils
log = logging.getLogger(__name__)
log.setLevel(logging.WARNING)
# Some strange Excel files have values that are marked as dates but are invalid as dates.