Skip to content

Simple ruby script to show content of a file with line highlighted in red, yellow or green based on content

Notifications You must be signed in to change notification settings

nhurion/colorlog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

‘colorlog` - Coloring logs in red/yellow/green based on regexp

Author

Nicolas Hurion

Copyright

Copyright © 2012 by Nicolas Hurion

License

Distribute under the Apache License

Color log is a simple tool that will take a file and display it, with some lines colored in three different colors, based on some regular expression.

Default behavior will show in:

  • green lines containing “success”

  • yellow lines containing “warning”

  • red lines containing “error” or “failure” and not containing “tests”

My initial need when I created this small tool was to spot warnings in the middle of all the output of maven. This should explain the default Regexp used.

Example usage:

mvn clean install | colorlog

Install ruby. If on windows go to ruby installer

Once installed

gem install colorlog

Or on windows

gem install colorlog windows-pr win32console

You can then use

mvn clean install | colorlog

And if it is too long for you, create a file mvnc.bat that you put somewhere in your path with the following content:

@echo off
mvn %* | colorlog

And you can then use

mvnc clean install

See help for usage

colorlog --help

About

Simple ruby script to show content of a file with line highlighted in red, yellow or green based on content

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages