Module: Phidgets::FFI::Log

Defined in:
lib/phidgets-ffi/ffi/log.rb

Class Method Summary collapse

Class Method Details

.log(loglevel, identifier, message, *args) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/phidgets-ffi/ffi/log.rb', line 17

def self.log(loglevel, identifier, message, *args)
  if !args.empty?
    ::Phidgets::FFI::CPhidget_log(loglevel, identifier, message, *args.to_varargs)
  else
    ::Phidgets::FFI::CPhidget_log(loglevel, identifier, message)
  end
end

.method_missing(method, *args, &block) ⇒ Object



25
26
27
28
29
30
31
32
33
34
# File 'lib/phidgets-ffi/ffi/log.rb', line 25

def self.method_missing(method, *args, &block)
	 
  if ::Phidgets::FFI.respond_to?("CPhidget_#{method}".to_sym)
if (rs = ::Phidgets::FFI.send("CPhidget_#{method}".to_sym, *args, &block)) != 0
			raise Phidgets::Error.exception_for(rs), Phidgets::FFI.error_description(rs)
    end
  else  
    super(method, *args, &block)
  end
end