Support Logging #583

Closed
mbleigh opened this Issue Mar 6, 2012 · 4 comments

Comments

Projects
None yet
4 participants
Contributor

mbleigh commented Mar 6, 2012

OmniAuth should have a logger accessible at OmniAuth.logger. This logger should probably just point at STDOUT by default but should be easily settable in, for instance, a Rails app like so:

OmniAuth.config.logger = Rails.logger

mbleigh closed this in 1a16151 Apr 12, 2012

lpsBetty commented May 4, 2012

I am testing invalid credentials:

OmniAuth.config.mock_auth[:facebook] = :invalid_credentials

the test works fine, but I am now getting an output when running tests:

(facebook) Authentication failure! invalid_credentials encountered.

I am using:
omniauth (1.1.0)
hashie (> 1.2)
rack
omniauth-facebook (1.2.0)
omniauth-oauth2 (
> 1.0.0)

how can I prevent this output?

lpsBetty commented May 14, 2012 edited

ok

OmniAuth.config.logger = Rails.logger

did it ;)

I am using omniauth 1.2.2. Although I put OmniAuth.config.logger = Rails.logger but it still prints output to console. And once I turn off console, omniauth cannot work anymore

I put it in initializer/omniauth.rb. here is a snapshot

Rails.application.config.middleware.use OmniAuth::Builder do
  require 'openid/store/filesystem'
  provider :openid, :name => 'NUS', :identifier => 'https://openid.nus.edu.sg/', :store => OpenID::Store::Filesystem.new('/tmp')
end
 OmniAuth.config.logger = Rails.logger

am I doing it wrongly?

wpp commented Apr 6, 2017

5 years later, still relevant and much appreciated: Thank you @lpsBetty! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment