comparison contrib/assimilate_alien_loggers.rb @ 7539:8dd89da79eaa

Added spooky ruby script to get started fixing logger instances of wrong classes.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Fri, 08 Nov 2013 10:22:32 +0100
parents
children
comparison
equal deleted inserted replaced
7538:06ebfc33578d 7539:8dd89da79eaa
1 # run like ruby -i -p assimilate_alien_loggers.rb FILES(or stdin)
2 # This will replace in-place and will result in wrong getLogger
3 # statements in certain inner-class scenarios! Be careful.
4
5 $last_class
6 if $_ =~ /class ([a-zA-Z0-9]+)/
7 $last_class = "#{$1}.class"
8 end
9 if $_ =~ /getLogger/
10 gsub(/getLogger[ ]*\(.*\)/, "getLogger(#{$last_class})")
11 end

http://dive4elements.wald.intevation.org