When trying to create a new ruby logger:
logger = Logger.new('my.log')
I'm getting an error:
NoMethodError: undefined method `new' for HTTParty::Logger:Module
Creating the logger from the Rails Console works fine. When trying to create it from the class is when it's getting the error. It appears that HTTParty is interfering with it. How do I specify that I wish to use the stdlib Logger instead of the gem HTTParty's Logger?
If you want to get the constant in 'root' namespace, you can use :: operator, like this:
logger = ::Logger.new('my.log')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With