module RTSP::Global
Constants
- DEFAULT_RTSP_PORT
- DEFAULT_VERSION
Attributes
log[W]
Sets whether to log RTSP
requests & responses.
log_level[W]
@return [Symbol] The Logger
method to use for logging all messages.
logger[W]
Sets the type logger to use.
raise_errors[W]
Use to disable the raising of +RTSP::Error+s.
Public Instance Methods
log(message)
click to toggle source
@param [String] message The string to log.
# File lib/rtsp/global.rb, line 38 def log(message) logger.send(log_level, message) if log? end
log?()
click to toggle source
@return [Boolean] true if logging is enabled; false if it’s turned off.
# File lib/rtsp/global.rb, line 12 def log? @log != false end
log_level()
click to toggle source
The Logger
method to use for logging all messages.
@return [Symbol] Defaults to :debug
.
# File lib/rtsp/global.rb, line 33 def log_level @log_level ||= :debug end
logger()
click to toggle source
By default, this creates a standard Ruby Logger
. If a different type was passed in via #logger=
, this returns that object.
@return [Logger]
# File lib/rtsp/global.rb, line 23 def logger @logger ||= ::Logger.new STDOUT end
raise_errors?()
click to toggle source
@return [Boolean] true if set to raise errors; false if not.
# File lib/rtsp/global.rb, line 46 def raise_errors? @raise_errors != false end
reset_config!()
click to toggle source
Resets class variables back to defaults.
# File lib/rtsp/global.rb, line 56 def reset_config! self.log = true self.logger = ::Logger.new STDOUT self.log_level = :debug self.raise_errors = true end
rtsp_version()
click to toggle source
@return [String] The RTSP
version.
# File lib/rtsp/global.rb, line 51 def rtsp_version @version ||= DEFAULT_VERSION end