module SSO::Logging
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.
Public Instance Methods
debug(&block)
click to toggle source
# File lib/sso/logging.rb, line 7 def debug(&block) logger && logger.debug(progname, &block) end
error(&block)
click to toggle source
# File lib/sso/logging.rb, line 19 def error(&block) logger && logger.error(progname, &block) end
fatal(&block)
click to toggle source
# File lib/sso/logging.rb, line 23 def fatal(&block) logger && logger.fatal(progname, &block) end
info(&block)
click to toggle source
# File lib/sso/logging.rb, line 11 def info(&block) logger && logger.info(progname, &block) end
logger()
click to toggle source
# File lib/sso/logging.rb, line 31 def logger ::SSO.config.logger end
progname()
click to toggle source
# File lib/sso/logging.rb, line 27 def progname self.class.name end
warn(&block)
click to toggle source
# File lib/sso/logging.rb, line 15 def warn(&block) logger && logger.warn(progname, &block) end