module Plogger
Constants
- VERSION
Public Instance Methods
config()
click to toggle source
# File lib/plogger.rb, line 13 def config @@config ||= Plogger::Config.new(logger) end
configure() { |config| ... }
click to toggle source
# File lib/plogger.rb, line 17 def configure yield(config) @@logger = config.logger @@config = config end
debug(message, type: 'system', category: '', user_id: '', account_id: '', extra_info: {})
click to toggle source
# File lib/plogger.rb, line 47 def debug(message, type: 'system', category: '', user_id: '', account_id: '', extra_info: {}) handler = Plogger::Handler.new(config) handler.handle_debug(message, category: category, user_id: user_id, account_id: account_id, extra_info: extra_info.merge({log_severity: 'debug'})) end
error(message, type: 'system', category: '', user_id: '', account_id: '', extra_info: {})
click to toggle source
# File lib/plogger.rb, line 29 def error(message, type: 'system', category: '', user_id: '', account_id: '', extra_info: {}) handler = Plogger::Handler.new(config) handler.handle_error(message, category: category, user_id: user_id, account_id: account_id, extra_info: extra_info.merge({log_severity: 'error'})) end
exception(exception, type: 'system', category: '', user_id: '', account_id: '', extra_info: {})
click to toggle source
# File lib/plogger.rb, line 23 def exception(exception, type: 'system', category: '', user_id: '', account_id: '', extra_info: {}) handler = Plogger::Handler.new(config) handler.handle_exception(exception, category: category, user_id: user_id, account_id: account_id, extra_info: extra_info.merge({log_severity: 'exception'})) end
info(message, type: 'system', category: '', user_id: '', account_id: '', extra_info: {})
click to toggle source
# File lib/plogger.rb, line 41 def info(message, type: 'system', category: '', user_id: '', account_id: '', extra_info: {}) handler = Plogger::Handler.new(config) handler.handle_info(message, category: category, user_id: user_id, account_id: account_id, extra_info: extra_info.merge({log_severity: 'info'})) end
logger()
click to toggle source
# File lib/plogger.rb, line 9 def logger @@logger ||= defined?(Rails) ? Rails.logger : Logger.new(STDOUT) end
warn(message, type: 'system', category: '', user_id: '', account_id: '', extra_info: {})
click to toggle source
# File lib/plogger.rb, line 35 def warn(message, type: 'system', category: '', user_id: '', account_id: '', extra_info: {}) handler = Plogger::Handler.new(config) handler.handle_warning(message, category: category, user_id: user_id, account_id: account_id, extra_info: extra_info.merge({log_severity: 'warn'})) end