comparison contrib/find_alien_loggers.rb @ 7538:06ebfc33578d

Whacky little script to find possibly wrong loggers.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Fri, 08 Nov 2013 08:03:42 +0100
parents
children
comparison
equal deleted inserted replaced
7537:b1c5a567d44b 7538:06ebfc33578d
1 #!/usr/bin/env ruby
2 # encoding: UTF-8
3
4 # Use like
5 # grep -ri getLogger src/ | ruby find_alien_loggers.rb
6 # Prints guesses about java source files where wrong logger is used to stderr.
7 ARGF.each_line do |line|
8 module_name = line.scan(/\/([^\/]*)\.java/)
9 next if module_name.nil?
10 next if module_name[0].nil?
11 module_name = module_name[0][0]
12 STDERR.puts line unless line.include?("#{module_name}.class")
13 end
14

http://dive4elements.wald.intevation.org