Module: Chronicle::ETL::Logger
Constant Summary collapse
- DEBUG =
0
- INFO =
1
- WARN =
2
- ERROR =
3
- FATAL =
4
- SILENT =
5
Instance Attribute Summary collapse
-
#log_level ⇒ Object
Returns the value of attribute log_level.
Instance Method Summary collapse
- #attach_to_ui(ui_element) ⇒ Object
- #debug(message) ⇒ Object
- #detach_from_ui ⇒ Object
- #error(message) ⇒ Object
- #fatal(message) ⇒ Object
- #info(message) ⇒ Object
- #output(message, level) ⇒ Object
Instance Attribute Details
#log_level ⇒ Object
Returns the value of attribute log_level.
13 14 15 |
# File 'lib/chronicle/etl/logger.rb', line 13 def log_level @log_level end |
Instance Method Details
#attach_to_ui(ui_element) ⇒ Object
43 44 45 |
# File 'lib/chronicle/etl/logger.rb', line 43 def attach_to_ui(ui_element) @ui_element = ui_element end |
#debug(message) ⇒ Object
39 40 41 |
# File 'lib/chronicle/etl/logger.rb', line 39 def debug() output(, DEBUG) end |
#detach_from_ui ⇒ Object
47 48 49 |
# File 'lib/chronicle/etl/logger.rb', line 47 def detach_from_ui @ui_element = nil end |
#error(message) ⇒ Object
31 32 33 |
# File 'lib/chronicle/etl/logger.rb', line 31 def error() output(, ERROR) end |
#fatal(message) ⇒ Object
27 28 29 |
# File 'lib/chronicle/etl/logger.rb', line 27 def fatal() output(, FATAL) end |
#info(message) ⇒ Object
35 36 37 |
# File 'lib/chronicle/etl/logger.rb', line 35 def info() output(, INFO) end |
#output(message, level) ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/chronicle/etl/logger.rb', line 17 def output(, level) return unless level >= @log_level if @ui_element @ui_element.log() else warn() end end |