Skip to content

Conversation

@adameska
Copy link

Logs before:
image

Logs after:
image

@adameska adameska requested review from a team, benoitf and feloy as code owners November 18, 2025 18:17
@adameska adameska requested review from gastoner and removed request for a team November 18, 2025 18:17
Signed-off-by: Hettinger, David <DHETTINGER@quad.com>
Signed-off-by: Hettinger, David <DHETTINGER@quad.com>
Signed-off-by: Hettinger, David <DHETTINGER@quad.com>
Signed-off-by: Adameska <hettinger14@outlook.com>
Copy link

@gastoner gastoner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise it seems like I get some highlighted words on Linux 👍

Image

expect(result2).toContain('\u001b[36m');
});

test('should handle abbreviated log levels', () => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes i can update that.

});

test('should handle full word log levels', () => {
const testCases = [

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

* @param lines - Array of log lines to analyze
* @returns true if logs should be treated as JSON format
*/
export function detectJsonLogs(lines: string[]): boolean {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be possible to do this for every line of logs? WDYT @feloy

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logs may have thousands of lines. And generally, all lines are in Json format, or none of them are, so this test seems legit to me

Copy link
Author

@adameska adameska Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer this route, the less i have to know/do the better... and colorizing lots of lines of json was plenty fast for me on my machine but the concern is valid. We could also add a menu option here if/when this PR gets completed to drive this behavior too... #417
image

Signed-off-by: Adameska <hettinger14@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants