Method: PDK::Context::AbstractContext#to_debug_log
- Defined in:
- lib/pdk/context.rb
#to_debug_log ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Writes the current context information, and parent contexts, to the PDK Debug Logger. This is mainly used by the PDK CLI when in debug mode to assist users to figure out why the PDK is misbehaving.
76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/pdk/context.rb', line 76 def to_debug_log current = self depth = 1 loop do PDK.logger.debug("Detected #{current.display_name} at #{current.root_path.nil? ? current.context_path : current.root_path}") current = current.parent_context break if current.nil? depth += 1 # Circuit breaker in case there are circular references break if depth > 20 end nil end |