lib/ProMotion/styling/styling.rb in ProMotion-2.4.0 vs lib/ProMotion/styling/styling.rb in ProMotion-2.4.1

- old
+ new

@@ -23,12 +23,14 @@ elsif v.is_a?(Array) && element.respond_to?("#{k}") && element.method("#{k}").arity == v.length element.send("#{k}", *v) elsif k.to_s.include?("_") # Snake case? set_attribute(element, camelize(k), v) else # Warn - PM.logger.debug "set_attribute: #{element.inspect} does not respond to #{k}=." - PM.logger.log("BACKTRACE", caller(0).join("\n"), :default) if PM.logger.level == :verbose + mp "set_attribute: #{element.inspect} does not respond to #{k}=.", force_color: :purple + # TODO - remove now, or when fully deprecated - there will be no verbose + # check when logger is removed + mp "BACKTRACE", caller(0).join("\n") if PM.logger.level == :verbose end element end def content_max(view, mode = :height) @@ -116,12 +118,12 @@ protected def get_attributes_from_symbol(attrs) return attrs if attrs.is_a?(Hash) - PM.logger.error "#{attrs} styling method is not defined" unless self.respond_to?(attrs) + mp("#{attrs} styling method is not defined", force_color: :red) unless self.respond_to?(attrs) new_attrs = send(attrs) - PM.logger.error "#{attrs} should return a hash" unless new_attrs.is_a?(Hash) + mp("#{attrs} should return a hash", force_color: :red) unless new_attrs.is_a?(Hash) new_attrs end def map_resize_symbol(symbol) @_resize_symbols ||= {