Files
flipper/desktop/plugins/logs/logUtils.tsx
Michel Weststrate 94eaaf5dca killed the concept of customizable column sets per device in device logs
Summary:
No device was using this feature, so doesn't look like there is a reason to keep it.

...if somebody was about to use this feature, let me know :). But probably, if we need this, a much more simple solution is to determine the visible columns with a simple switch on device type in the logs plugin, even though that is strictly speaking less scalable. But the current solution feels a bit over-engineered for something that is not really used.

Marked [interesting] as I might be missing some background concept which would make this relevant as well.

Reviewed By: jknoxville, nikoant

Differential Revision: D22763507

fbshipit-source-id: ecdbc779cbbfa3b0b72c80b459b12c1a25bf3fc4
2020-08-04 07:47:14 -07:00

30 lines
591 B
TypeScript

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
export function getLineCount(str: string): number {
let count = 1;
if (!(typeof str === 'string')) {
return 0;
}
for (let i = 0; i < str.length; i++) {
if (str[i] === '\n') {
count++;
}
}
return count;
}
export function pad(chunk: any, len: number): string {
let str = String(chunk);
while (str.length < len) {
str = `0${str}`;
}
return str;
}