Module: Integrations::Loggable
- Included in:
- Integration
- Defined in:
- app/models/concerns/integrations/loggable.rb
Instance Method Summary collapse
- #build_message(message, params = {}) ⇒ Object
- #log_error(message, params = {}) ⇒ Object
- #log_exception(error, params = {}) ⇒ Object
- #log_info(message, params = {}) ⇒ Object
- #logger ⇒ Object
Instance Method Details
#build_message(message, params = {}) ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'app/models/concerns/integrations/loggable.rb', line 23 def (, params = {}) { integration_class: self.class.name, integration_id: id, project_id: project&.id, project_path: project&.full_path, message: }.merge(params) end |
#log_error(message, params = {}) ⇒ Object
11 12 13 14 15 |
# File 'app/models/concerns/integrations/loggable.rb', line 11 def log_error(, params = {}) = (, params) logger.error() end |
#log_exception(error, params = {}) ⇒ Object
17 18 19 20 21 |
# File 'app/models/concerns/integrations/loggable.rb', line 17 def log_exception(error, params = {}) Gitlab::ExceptionLogFormatter.format!(error, params) log_error(params[:message] || error., params) end |
#log_info(message, params = {}) ⇒ Object
5 6 7 8 9 |
# File 'app/models/concerns/integrations/loggable.rb', line 5 def log_info(, params = {}) = (, params) logger.info() end |
#logger ⇒ Object
33 34 35 |
# File 'app/models/concerns/integrations/loggable.rb', line 33 def logger Gitlab::IntegrationsLogger end |