Skip to content

Commit

Permalink
don't trim messages
Browse files Browse the repository at this point in the history
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
  • Loading branch information
danielbuechele authored and facebook-github-bot committed Jan 31, 2019
1 parent 5aff7cf commit 88cc299
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/plugins/logs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -340,7 +336,9 @@ export function processEntry(
),
},
message: {
value: <HiddenScrollText code={true}>{message}</HiddenScrollText>,
value: (
<HiddenScrollText code={true}>{entry.message}</HiddenScrollText>
),
},
tag: {
value: <HiddenScrollText code={true}>{entry.tag}</HiddenScrollText>,
Expand All @@ -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,
Expand Down Expand Up @@ -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}`, {
Expand Down

0 comments on commit 88cc299

Please sign in to comment.