Skip to content

Commit f522401

Browse files
committed
fix(logs): don't trim leading whitespace
1 parent 7a40ca7 commit f522401

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/common/mobile/device-log-provider.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export class DeviceLogProvider extends DeviceLogProviderBase {
143143

144144
const toLog = [timeLabel ?? "", match ? line.replace(match, "") : line]
145145
.join("")
146-
.trim();
146+
.trimEnd();
147147

148148
toLog.split("\n").forEach((actualLine) => {
149149
this.printLine(

lib/services/ios-log-filter.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,11 @@ export class IOSLogFilter implements Mobile.IPlatformLogFilter {
8282
currentLine = currentLine.replace(filteredLineInfo[0], "");
8383
}
8484

85-
currentLine = currentLine.trim();
85+
currentLine = currentLine
86+
// remove lading space before CONSOLE
87+
.replace(/^\s*CONSOLE/, "CONSOLE")
88+
// trim trailing spaces only to preserve indentation
89+
.trimEnd();
8690

8791
// post filtering: (<anything>) check if <anything> is not "NativeScript"
8892
const postFilterMatch = this.postFilterRegex.exec(currentLine);

0 commit comments

Comments
 (0)