Class: Phidgets::Log

Inherits:
Object
  • Object
show all
Defined in:
lib/phidgets-ffi/log.rb

Constant Summary collapse

Klass =
Phidgets::FFI::Log

Class Method Summary collapse

Class Method Details

.disableBoolean

Disables logging, or raises an error.

Returns:

  • (Boolean)

    returns true, or raises an error.



16
17
18
19
# File 'lib/phidgets-ffi/log.rb', line 16

def self.disable
  Klass.disableLogging
  true
end

.enable(loglevel = :warning, filename = nil) ⇒ Boolean

Enables logging, or raises an error.

Parameters:

  • level (Phidgets::FFI::LogLevel)

    The highest level of logging to output. All lower levels will also be output.

  • output_file (String)

    File to output log to. This should be a full pathname, not a relative pathname. Optional. If no output file is specified, the output will print to console.

Returns:

  • (Boolean)

    returns true, or raises an error.



9
10
11
12
# File 'lib/phidgets-ffi/log.rb', line 9

def self.enable(loglevel=:warning, filename=nil)
  Klass.enableLogging(loglevel, filename.to_s)
  true
end

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

Appends a message to the log, or raises an error.

Parameters:

  • level (Phidgets::FFI::LogLevel)

    the level at which to log the message.

  • output_file (String)

    File to output log to. This should be a full pathname, not a relative pathname. Optional. If no output file is specified, the output will print to console.

  • message (String)

    the message

Returns:

  • (Boolean)

    returns true, or raises an error.



26
27
28
# File 'lib/phidgets-ffi/log.rb', line 26

def self.log(loglevel, identifier, message, *args)
  Klass.log(loglevel, identifier, message, *args)
end