From 88cc2998112468757531f50713c8d3156c85af4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20B=C3=BCchele?= Date: Thu, 31 Jan 2019 05:45:08 -0800 Subject: [PATCH] don't trim messages Summary: Don't trim messages to allow indentation using spaces. (e.g. for dispalying hierarchical data) Reviewed By: jknoxville Differential Revision: D13895630 fbshipit-source-id: 2c0e075bdecb6ab850a8ed7ed52c8423fa9343f2 --- src/plugins/logs/index.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/plugins/logs/index.js b/src/plugins/logs/index.js index 6ba92cd2d..bac1b1cf2 100644 --- a/src/plugins/logs/index.js +++ b/src/plugins/logs/index.js @@ -317,10 +317,6 @@ export function processEntry( } { const {icon, style} = LOG_TYPES[(entry.type: string)] || LOG_TYPES.debug; - // clean message - const message = entry.message.trim(); - entry.type === 'error'; - // build the item, it will either be batched or added straight away return { entry, @@ -340,7 +336,9 @@ export function processEntry( ), }, message: { - value: {message}, + value: ( + {entry.message} + ), }, tag: { value: {entry.tag}, @@ -363,7 +361,7 @@ export function processEntry( isFilterable: true, }, }, - height: getLineCount(message) * 15 + 10, // 15px per line height + 8px padding + height: getLineCount(entry.message) * 15 + 10, // 15px per line height + 8px padding style, type: entry.type, filterValue: entry.message, @@ -470,10 +468,9 @@ export default class LogTable extends FlipperDevicePlugin< } incrementCounterIfNeeded = (entry: DeviceLogEntry) => { - const message = entry.message.trim(); let counterUpdated = false; const counters = this.state.counters.map(counter => { - if (message.match(counter.expression)) { + if (entry.message.match(counter.expression)) { counterUpdated = true; if (counter.notify) { new window.Notification(`${counter.label}`, {