Author Topic: Simple way to highlight or colour code log custom text files  (Read 280 times)

0 Members and 1 Guest are viewing this topic.

Online ricko_ukTopic starter

  • Super Contributor
  • ***
  • Posts: 1081
  • Country: gb
Simple way to highlight or colour code log custom text files
« on: September 02, 2024, 05:35:07 pm »
Hi,
I am generating text-type log files and would like to make them easier to read. Is there some utility that colors the entire line based perhaps on the first word/token?

Thank you
 

Online IanB

  • Super Contributor
  • ***
  • Posts: 12344
  • Country: us
Re: Simple way to highlight or colour code log custom text files
« Reply #1 on: September 02, 2024, 05:49:29 pm »
Perhaps use Markdown?
 

Offline xvr

  • Frequent Contributor
  • **
  • Posts: 411
  • Country: ie
    • LinkedIn
Re: Simple way to highlight or colour code log custom text files
« Reply #2 on: September 02, 2024, 06:04:13 pm »
Quote
Is there some utility that colors the entire line based perhaps on the first word/token?
Write log in HTML format, so any WEB browser could be used to open it.
 

Offline PlainName

  • Super Contributor
  • ***
  • Posts: 7196
  • Country: va
Re: Simple way to highlight or colour code log custom text files
« Reply #3 on: September 02, 2024, 06:08:59 pm »
LogFusion might do it. Well, I know it can do whole line highlighting based on some text in the line, but I'm not sure you can restrict that to the first word.

https://www.logfusion.ca/

Worth stating if you want something that will deal existing format, of if you're up to changing the format to suit the viewer (perhaps by embedding HTML or Markdown as suggested above).

There is a very good log file viewer that would easily do this (and more) but I loath the developer's greed and restrictive license, so I won't mention it :)
 

Offline ajb

  • Super Contributor
  • ***
  • Posts: 2721
  • Country: us
Re: Simple way to highlight or colour code log custom text files
« Reply #4 on: September 03, 2024, 04:03:14 pm »
I don't know of anything ready-made, but it would be pretty easy to turn a plain text file into HTML using JavaScript, with whatever content-based styling you want.  You can do everything in a single client-side js/html file, so it would be very portable.  It would also be very easy to add interactive filtering, navigation ('jump to next error' links), statistics, etc. 

Perhaps use Markdown?

I love me some markdown, but I don't know of an implementation that includes any kind of color coding.  You could of course apply a custom stylesheet that assigns colors to different emphasis tags, but then you wouldn't be able to use them for emphasis as well, if that were desirable. 
 

Offline unseenninja

  • Regular Contributor
  • *
  • Posts: 74
  • Country: se
Re: Simple way to highlight or colour code log custom text files
« Reply #5 on: September 03, 2024, 08:01:08 pm »
A program called "baretail" can do what you need.



Still free from https://baremetalsoft.com/baretail/

I've used it for years on Windows systems as it can follow a log as it is being written, as well as viewing them after the fact.
 

Online ricko_ukTopic starter

  • Super Contributor
  • ***
  • Posts: 1081
  • Country: gb
Re: Simple way to highlight or colour code log custom text files
« Reply #6 on: September 03, 2024, 08:24:43 pm »
Thank you all!

I was literally typing a reply when @unseenninja posted his reply. What he suggests and also LogFusion do exactly what I was looking for. But using HTML is also a nice suggestion. So for the future I will also implement HTML formatting into my log file genertor.

Thank you
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf