Module: DRbService::Logging::ClassMethods

Defined in:
lib/drbservice/utils.rb

Overview

A collection of class methods that will get added as class method to anything that includes Logging.

Instance Method Summary collapse

Instance Method Details

#reset_loggerObject

Reset the global logger object to the default



355
356
357
358
359
# File 'lib/drbservice/utils.rb', line 355

def reset_logger
	self.logger = self.default_logger
	self.logger.level = Logger::WARN
	self.logger.formatter = self.default_log_formatter
end

#using_default_logger?Boolean

Returns true if the global logger has not been set to something other than the default one.

Returns:

  • (Boolean)


364
365
366
# File 'lib/drbservice/utils.rb', line 364

def using_default_logger?
	return self.logger == self.default_logger
end

#version_string(include_buildnum = false) ⇒ Object

Return the library’s version string



370
371
372
373
374
375
376
377
# File 'lib/drbservice/utils.rb', line 370

def version_string( include_buildnum=false )
	vstring = "%s %s" % [ self.name, self.const_get(:VERSION) ]
	if include_buildnum
		rev = self.const_get(:REVISION)[/: ([[:xdigit:]]+)/, 1] rescue '0'
		vstring << " (build %s)" % [ rev ]
	end
	return vstring
end