module Net::SSH::Loggable
def debug
Displays the result of yielding if the log level is Logger::DEBUG or
def debug logger.add(Logger::DEBUG, nil, facility) { yield } if logger && logger.debug? end
def error
Displays the result of yielding if the log level is Logger:ERROR or
def error logger.add(Logger::ERROR, nil, facility) { yield } if logger && logger.error? end
def facility
originates. It defaults to the name of class with the object_id
Sets the "facility" value, used for reporting where a log message
def facility @facility ||= self.class.to_s.gsub(/::/, ".").gsub(/([a-z])([A-Z])/, "\\1_\\2").downcase + "[%x]" % object_id end
def fatal
Displays the result of yielding if the log level is Logger::FATAL or
def fatal logger.add(Logger::FATAL, nil, facility) { yield } if logger && logger.fatal? end
def info
Displays the result of yielding if the log level is Logger::INFO or
def info logger.add(Logger::INFO, nil, facility) { yield } if logger && logger.info? end
def lwarn
Displays the result of yielding if the log level is Logger::WARN or
def lwarn logger.add(Logger::WARN, nil, facility) { yield } if logger && logger.warn? end