Module: SSO::Logging
- Included in:
- Benchmarking, Client::Authentications::Passport, Client::Warden::Hooks::AfterFetch, Client::Warden::Strategies::Passport, Configuration, Meter, Server::Authentications::Passport, Server::Doorkeeper::AccessTokenMarker, Server::Doorkeeper::GrantMarker, Server::Doorkeeper::ResourceOwnerAuthenticator, Server::Middleware::PassportDestruction, Server::Middleware::PassportExchange, Server::Middleware::PassportVerification, Server::Passport, Server::Passports, Server::Passports::Activity, Server::Warden::Hooks::AfterAuthentication, Server::Warden::Hooks::BeforeLogout, Server::Warden::Strategies::Passport
- Defined in:
- lib/sso/logging.rb
Overview
One thing tha bugs me is when I cannot see which part of the code caused a log message. This mixin will include the current class name as Logger ‘progname` so you can show that it in your logfiles.
Instance Method Summary collapse
- #debug(&block) ⇒ Object
- #error(&block) ⇒ Object
- #fatal(&block) ⇒ Object
- #info(&block) ⇒ Object
- #logger ⇒ Object
- #progname ⇒ Object
- #warn(&block) ⇒ Object
Instance Method Details
#debug(&block) ⇒ Object
7 8 9 |
# File 'lib/sso/logging.rb', line 7 def debug(&block) logger && logger.debug(progname, &block) end |
#error(&block) ⇒ Object
19 20 21 |
# File 'lib/sso/logging.rb', line 19 def error(&block) logger && logger.error(progname, &block) end |
#fatal(&block) ⇒ Object
23 24 25 |
# File 'lib/sso/logging.rb', line 23 def fatal(&block) logger && logger.fatal(progname, &block) end |
#info(&block) ⇒ Object
11 12 13 |
# File 'lib/sso/logging.rb', line 11 def info(&block) logger && logger.info(progname, &block) end |
#progname ⇒ Object
27 28 29 |
# File 'lib/sso/logging.rb', line 27 def progname self.class.name end |
#warn(&block) ⇒ Object
15 16 17 |
# File 'lib/sso/logging.rb', line 15 def warn(&block) logger && logger.warn(progname, &block) end |