Class: Contrast::Agent::Reporting::Settings::LogEnhancer
- Defined in:
- lib/contrast/agent/reporting/settings/log_enhancer.rb
Overview
All of the apis to add new logging calls to the application at runtime
Constant Summary collapse
- ATTRIBUTES =
%i[id api format level name type].cs__freeze
- LOG_LEVELS =
%w[TRACE DEBUG INFO WARN ERROR].cs__freeze
- TYPES =
%w[AUDIT ERROR SECURITY].cs__freeze
Instance Attribute Summary collapse
-
#api ⇒ Object
Returns the value of attribute api.
-
#format ⇒ Object
Returns the value of attribute format.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#level ⇒ Object
[ TRACE, DEBUG, INFO, WARN, ERROR ].
-
#level=(new_level) ⇒ Object
[ TRACE, DEBUG, INFO, WARN, ERROR ].
- #to_controlled_hash ⇒ Object
-
#type ⇒ Object
[ AUDIT, ERROR, SECURITY ].
-
#type=(new_type) ⇒ Object
[ AUDIT, ERROR, SECURITY ].
Instance Attribute Details
#api ⇒ Object
Returns the value of attribute api.
17 18 19 |
# File 'lib/contrast/agent/reporting/settings/log_enhancer.rb', line 17 def api @api end |
#format ⇒ Object
Returns the value of attribute format.
19 20 21 |
# File 'lib/contrast/agent/reporting/settings/log_enhancer.rb', line 19 def format @format end |
#id ⇒ Object
Returns the value of attribute id.
21 22 23 |
# File 'lib/contrast/agent/reporting/settings/log_enhancer.rb', line 21 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
23 24 25 |
# File 'lib/contrast/agent/reporting/settings/log_enhancer.rb', line 23 def name @name end |
Instance Method Details
#level ⇒ Object
- TRACE, DEBUG, INFO, WARN, ERROR
27 28 29 |
# File 'lib/contrast/agent/reporting/settings/log_enhancer.rb', line 27 def level @_level ||= Contrast::Utils::ObjectShare::EMPTY_STRING end |
#level=(new_level) ⇒ Object
- TRACE, DEBUG, INFO, WARN, ERROR
34 35 36 |
# File 'lib/contrast/agent/reporting/settings/log_enhancer.rb', line 34 def level= new_level @_level = new_level if LOG_LEVELS.include?(new_level) end |
#to_controlled_hash ⇒ Object
51 52 53 54 55 56 57 58 59 60 |
# File 'lib/contrast/agent/reporting/settings/log_enhancer.rb', line 51 def to_controlled_hash { id: id, api: api, format: format, name: name, # rubocop:disable Security/Module/Name level: level, type: type } end |
#type ⇒ Object
- AUDIT, ERROR, SECURITY
40 41 42 |
# File 'lib/contrast/agent/reporting/settings/log_enhancer.rb', line 40 def type @_type ||= Contrast::Utils::ObjectShare::EMPTY_STRING end |