Class: SPSPubLogDRbClient

Inherits:
Object
  • Object
show all
Defined in:
lib/spspublog_drb_client.rb

Defined Under Namespace

Modules: Severity

Constant Summary collapse

DEBUG =
Severity::DEBUG
INFO =
Severity::INFO
WARN =
Severity::WARN
ERROR =
Severity::ERROR
FATAL =
Severity::FATAL
UNKNOWN =
Severity::UNKNOWN

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host: '127.0.0.1', port: '9090', level: Severity::DEBUG) ⇒ SPSPubLogDRbClient

Returns a new instance of SPSPubLogDRbClient.



34
35
36
37
38
39
40
41
# File 'lib/spspublog_drb_client.rb', line 34

def initialize(host: '127.0.0.1', port: '9090', level: Severity::DEBUG)

  DRb.start_service
  
  @log = DRbObject.new nil, "druby://#{host}:#{port}"
  @log.level = level

end

Instance Attribute Details

#levelObject

Returns the value of attribute level.



32
33
34
# File 'lib/spspublog_drb_client.rb', line 32

def level
  @level
end

Instance Method Details

#debug(s) ⇒ Object



43
44
45
# File 'lib/spspublog_drb_client.rb', line 43

def debug(s)
  @log.debug s
end

#error(s) ⇒ Object



47
48
49
# File 'lib/spspublog_drb_client.rb', line 47

def error(s)
  @log.error s
end

#fatal(s) ⇒ Object



51
52
53
# File 'lib/spspublog_drb_client.rb', line 51

def fatal(s)
  @log.fatal s
end

#info(s) ⇒ Object



55
56
57
# File 'lib/spspublog_drb_client.rb', line 55

def info(s)
  @log.info s
end