From bf2f1283d38b40f447fe62edaca0d413cfa7c24a Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Tue, 13 Jun 2023 08:17:03 -0700 Subject: [PATCH] Unbreak error logging Summary: *Potentially. A big thanks to lblasa and aigoncharov for helping with debugging. Looking at `ptail -f errorlog_flipper_javascript` reveals that messages now include a spurious amount of unescaped newlines. E.g. P768993195 From memory, these were not there when I wrote the categorizer when I was able to copy-paste from ptail to the unit tests. D44729490 added prettifying to the results inadvertently. Reviewed By: lblasa Differential Revision: D46685543 fbshipit-source-id: 98da5eff92900042fc5306ca5d5652d8940ff2e1 --- desktop/flipper-plugin-core/src/utils/safeStringify.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/desktop/flipper-plugin-core/src/utils/safeStringify.tsx b/desktop/flipper-plugin-core/src/utils/safeStringify.tsx index 5353d6115..b7f7eda8e 100644 --- a/desktop/flipper-plugin-core/src/utils/safeStringify.tsx +++ b/desktop/flipper-plugin-core/src/utils/safeStringify.tsx @@ -7,9 +7,9 @@ * @format */ -export function safeStringify(value: any) { +export function safeStringify(value: any, space: number = 2) { try { - return JSON.stringify(value, null, 2); + return JSON.stringify(value, null, space); } catch (e) { return ''; }