Module: WinRM::Transport::Logging
- Included in:
- CommandExecutor, FileTransporter, TmpZip
- Defined in:
- lib/winrm/transport/logging.rb
Overview
Mixin to use an optionally provided logger for logging.
Instance Method Summary collapse
-
#debug(msg = nil) { ... } ⇒ Object
Logs a message on the logger at the debug level, if a logger is present.
-
#log_subject ⇒ String
The subject for log messages.
Instance Method Details
#debug(msg = nil) { ... } ⇒ Object
Logs a message on the logger at the debug level, if a logger is present.
34 35 36 37 |
# File 'lib/winrm/transport/logging.rb', line 34 def debug(msg = nil, &block) return if logger.nil? || !logger.debug? logger.debug("[#{log_subject}] " << (msg || block.call)) end |
#log_subject ⇒ String
The subject for log messages.
42 43 44 |
# File 'lib/winrm/transport/logging.rb', line 42 def log_subject @log_subject ||= self.class.to_s.split("::").last end |