pauldowman / better_logging

(Old/dead) A Rails plugin that improves the log format.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

problems with encodings

vsespb opened this issue · comments

  1. I had crashes at this line
message = message.gsub(/^/, @@line_prefix) if @@verbose

because @@line_prefix was in 'UTF-8' and message was in 'US-ASCII'

only ruby 1.9.3.p0 affected - 1.9.3.p194 is OK.

I was able to fix it by adding something like

message.force_encoding("BINARY") if message.respond_to?(:force_encoding) && message.encoding.name != 'UTF-8'

before

message = message.gsub(/^/, @@line_prefix) if @@verbose
@@verbose = Rails.env == "development"

are you sure that checking rails env name in gem is a good idea ? It was pretty hard for me to find why I have two identical environments with same settings and only one of them is crashing.

Thanks. I'll check it out as soon as I can.

@pauldowman any news on that? Or may be you can suggest some other gem with the similar functionality?

@dmitry Sorry for the slow reply. I'm forced to admit that I don't have time at the moment. I've recently stopped using this myself but if anyone wants to take over maintenance I'd be happy to give the project away and do what I can to help.

@pauldowman if you don't mind, you can add myself to the git maintainers, I will try to support it as far as I will have some free time.

@dmitry How about you fork it, and I'll update my README pointing people to your fork?