mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Fix issue with sandboxUtil where %s in message would get interpreted wrongly
Summary: - Also converted sandboxUtil to typescript. - The issue with %s manifested when a Python traceback contained "%s" in the string; in that case the object with log metadata (e.g. docId) would confusingly replace %s as if it were part of the message from Python. Test Plan: Added a test case for the fix. Reviewers: alexmojaki Reviewed By: alexmojaki Differential Revision: https://phab.getgrist.com/D3486
This commit is contained in:
@@ -126,7 +126,7 @@ export function setTmpLogLevel(level: string, optCaptureFunc?: (level: string, m
|
||||
* captures those at minLevel and higher. Returns a promise for the array of "level: message"
|
||||
* strings. These may be tested using testUtils.assertMatchArray(). Callback may return a promise.
|
||||
*/
|
||||
export async function captureLog(minLevel: string, callback: any) {
|
||||
export async function captureLog(minLevel: string, callback: () => void|Promise<void>): Promise<string[]> {
|
||||
const messages: string[] = [];
|
||||
const prevLogLevel = log.transports.file.level;
|
||||
const name = _.uniqueId('CaptureLog');
|
||||
|
||||
Reference in New Issue
Block a user