Don't know may be it someone be useful I have prepared a patch that returns the old puppet 2.7 color style (patch in attach)
just run from <puppet_gem>/lib/puppet/util/log location for me it's a /var/lib/gems/1.8/gems/puppet-3.0.1/lib/puppet/util/log: patch -p1 < ./destinations_oldStyleColor.patch and enjoy :) среда, 31 октября 2012 г., 19:37:56 UTC+2 пользователь thinkwell написал: > > A trivial post, perhaps, but I liked the console coloring of 2.7 much > better than 3.0. Is there a way to get the 2.7 coloring back or to > customize the console color scheme? > > TIA, > > Dave > -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/xji-WPopZdAJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
--- ./destinations.rb 2012-11-14 14:18:01.349546620 +0000 +++ ./destinations_oldStyleColor.rb 2012-11-14 14:16:14.777764904 +0000 @@ -101,31 +101,14 @@ def initialize # Flush output immediately. - $stderr.sync = true $stdout.sync = true end def handle(msg) - error_levels = { - :warning => 'Warning', - :err => 'Error', - :alert => 'Alert', - :emerg => 'Emergency', - :crit => 'Critical' - } - - str = msg.respond_to?(:multiline) ? msg.multiline : msg.to_s - str = msg.source == "Puppet" ? str : "#{msg.source}: #{str}" - - case msg.level - when *error_levels.keys - $stderr.puts colorize(:hred, "#{error_levels[msg.level]}: #{str}") - when :info - $stdout.puts "#{colorize(:green, 'Info')}: #{str}" - when :debug - $stdout.puts "#{colorize(:cyan, 'Debug')}: #{str}" + if msg.source == "Puppet" + puts colorize(msg.level, "#{msg.level}: #{msg}") else - $stdout.puts str + puts colorize(msg.level, "#{msg.level}: #{msg.source}: #{msg}") end end end