module WinRM::Transport::Logging
Mixin to use an optionally provided logger for logging.
@author Fletcher Nichol <fnichol@nichol.ca>
Public Instance Methods
debug(msg = nil, &block)
click to toggle source
Logs a message on the logger at the debug level, if a logger is present.
@param msg [String] a message to log @yield evaluates and uses return value as message to log. If msg
parameter is set, it will take precedence over the block.
# File lib/winrm/transport/logging.rb, line 33 def debug(msg = nil, &block) return if logger.nil? || !logger.debug? logger.debug("[#{log_subject}] " << (msg || block.call)) end
log_subject()
click to toggle source
The subject for log messages.
@return [String] log subject
# File lib/winrm/transport/logging.rb, line 41 def log_subject @log_subject ||= self.class.to_s.split("::").last end