github
1318 of 1466 branches covered (89.9%)
Branch coverage included in aggregate %.
104 of 2237 new or added lines in 31 files covered. (4.65%)
5272 of 8831 relevant lines covered (59.7%)
32.17 hits per line
NEW
|
export default class Logger { |
× |
NEW
|
static log(input: string, tag: string = '[PageSpy]') { |
× |
NEW
|
const MAX_LENGTH: number = 1023; |
× |
NEW
|
|
× |
NEW
|
let startIndex: number = 0;
|
× |
NEW
|
let endIndex: number = 0;
|
× |
NEW
|
const content = `${tag} ${input}`; |
× |
NEW
|
if (content.length > MAX_LENGTH) {
|
× |
NEW
|
endIndex = MAX_LENGTH; |
× |
NEW
|
startIndex = 0;
|
× |
NEW
|
const count = Math.ceil(content.length / MAX_LENGTH);
|
× |
NEW
|
for (let a = 0; a < count; a++) { |
× |
NEW
|
console.log(content.substring(startIndex, endIndex)); |
× |
NEW
|
|
× |
NEW
|
startIndex = endIndex; |
× |
NEW
|
if (endIndex + MAX_LENGTH > content.length) {
|
× |
NEW
|
endIndex = content.length; |
× |
NEW
|
} else {
|
× |
NEW
|
endIndex += MAX_LENGTH; |
× |
NEW
|
} |
× |
NEW
|
} |
× |
NEW
|
} else {
|
× |
NEW
|
console.log(content); |
× |
NEW
|
} |
× |
NEW
|
} |
× |
NEW
|
} |
× |