Module: RSMP::Logging
Instance Attribute Summary collapse
-
#archive ⇒ Object
readonly
Returns the value of attribute archive.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Instance Method Summary collapse
Instance Attribute Details
#archive ⇒ Object (readonly)
Returns the value of attribute archive.
7 8 9 |
# File 'lib/rsmp/log/logging.rb', line 7 def archive @archive end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
7 8 9 |
# File 'lib/rsmp/log/logging.rb', line 7 def logger @logger end |
Instance Method Details
#author ⇒ Object
14 |
# File 'lib/rsmp/log/logging.rb', line 14 def ; end |
#initialize_logging(options) ⇒ Object
9 10 11 12 |
# File 'lib/rsmp/log/logging.rb', line 9 def initialize_logging() @archive = [:archive] || RSMP::Archive.new @logger = [:logger] || RSMP::Logger.new([:log_settings]) end |
#log(str, options = {}) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/rsmp/log/logging.rb', line 16 def log(str, = {}) default = { text: str, level: :log, author: , ip: @ip, port: @port } prepared = RSMP::Archive.prepare_item default.merge() @archive.add prepared @logger.log prepared prepared end |