class BlackStack::RemoteLogger
Attributes
api_domain[RW]
api_key[RW]
api_port[RW]
api_protocol[RW]
id_client[RW]
Public Class Methods
new(the_filename, the_api_protocol, the_api_domain, the_api_port, the_api_key, the_id_client=nil)
click to toggle source
Calls superclass method
BlackStack::BaseLogger::new
# File lib/remotelogger.rb, line 6 def initialize(the_filename, the_api_protocol, the_api_domain, the_api_port, the_api_key, the_id_client=nil) super(the_filename) self.api_protocol = the_api_protocol self.api_domain = the_api_domain self.api_port = the_api_port self.api_key = the_api_key self.id_client = the_id_client end
Public Instance Methods
log(s, datetime=nil)
click to toggle source
Calls superclass method
BlackStack::BaseLogger#log
# File lib/remotelogger.rb, line 29 def log(s, datetime=nil) ltext = super(s, datetime) =begin url = "#{self.api_protocol}://#{self.api_domain}:#{self.api_port.to_s}/api1.4/scl/log.json" res = BlackStack::Netting::api_call(url, { 'api_key' => self.api_key, 'filename' => self.filename, 'text' => s, 'method' => BlackStack::BaseLogger::METHOD_LOG, 'id_client' => self.id_client, }) =end ltext end
logf(s, datetime=nil)
click to toggle source
Calls superclass method
BlackStack::BaseLogger#logf
# File lib/remotelogger.rb, line 59 def logf(s, datetime=nil) ltext = super(s, datetime) =begin url = "#{self.api_protocol}://#{self.api_domain}:#{self.api_port.to_s}/api1.4/scl/log.json" res = BlackStack::Netting::api_call(url, { 'api_key' => self.api_key, 'filename' => self.filename, 'text' => s, 'method' => BlackStack::BaseLogger::METHOD_LOGF, 'id_client' => self.id_client, }) =end ltext end
logs(s, datetime=nil)
click to toggle source
Calls superclass method
BlackStack::BaseLogger#logs
# File lib/remotelogger.rb, line 44 def logs(s, datetime=nil) ltext = super(s, datetime) =begin url = "#{self.api_protocol}://#{self.api_domain}:#{self.api_port.to_s}/api1.4/scl/log.json" res = BlackStack::Netting::api_call(url, { 'api_key' => self.api_key, 'filename' => self.filename, 'text' => s, 'method' => BlackStack::BaseLogger::METHOD_LOGS, 'id_client' => self.id_client, }) =end ltext end
release()
click to toggle source
# File lib/remotelogger.rb, line 74 def release() =begin url = "#{self.api_url}:#{self.api_port.to_s}/api1.4/scl/release.json" res = BlackStack::Netting::api_call(url, { 'api_key' => self.api_key, 'filename' => self.filename, 'id_client' => self.id_client, }) =end end
reset()
click to toggle source
call the parent class to set the attributes call the save method to store the new attributes into the data file
Calls superclass method
BlackStack::BaseLogger#reset
# File lib/remotelogger.rb, line 17 def reset() super =begin url = "#{self.api_protocol}://#{self.api_domain}:#{self.api_port.to_s}/api1.4/scl/reset.json" res = BlackStack::Netting::api_call(url, { 'api_key' => self.api_key, 'filename' => self.filename, 'id_client' => self.id_client, }) =end end