diff --git a/lib/ProMotion/map/map_screen_annotation.rb b/lib/ProMotion/map/map_screen_annotation.rb index c1fb031..1cdcd9e 100644 --- a/lib/ProMotion/map/map_screen_annotation.rb +++ b/lib/ProMotion/map/map_screen_annotation.rb @@ -14,7 +14,7 @@ def initialize(params = {}) elsif @params[:latitude] && @params[:longitude] @coordinate = CLLocationCoordinate2D.new(@params[:latitude], @params[:longitude]) else - PM.logger.error("You are required to specify :latitude and :longitude or :coordinate for annotations.") + mp "You are required to specify :latitude and :longitude or :coordinate for annotations.", force_color: :red nil end end @@ -57,14 +57,14 @@ def method_missing(meth, *args) if @params[meth.to_sym] @params[meth.to_sym] else - PM.logger.warn "The annotation parameter \"#{meth}\" does not exist on this pin." + mp "The annotation parameter \"#{meth}\" does not exist on this pin." nil end end # Deprecated def annotation_params - PM.logger.warn("annotation.annotation_params is deprecated and will be removed soon. Please use annotation.params instead.") + mp "annotation.annotation_params is deprecated and will be removed soon. Please use annotation.params instead." @params end diff --git a/lib/ProMotion/map/map_screen_module.rb b/lib/ProMotion/map/map_screen_module.rb index c4f5c6c..71985f3 100644 --- a/lib/ProMotion/map/map_screen_module.rb +++ b/lib/ProMotion/map/map_screen_module.rb @@ -24,7 +24,7 @@ def view_will_appear(animated) end def check_annotation_data - PM.logger.error "Missing #annotation_data method in MapScreen #{self.class.to_s}." unless self.respond_to?(:annotation_data) + mp "Missing #annotation_data method in MapScreen #{self.class.to_s}.", force_color: :red unless self.respond_to?(:annotation_data) end def update_annotation_data @@ -42,8 +42,8 @@ def center end def center=(params={}) - PM.logger.error "Missing #:latitude property in call to #center=." unless params[:latitude] - PM.logger.error "Missing #:longitude property in call to #center=." unless params[:longitude] + mp "Missing #:latitude property in call to #center=.", force_color: :red unless params[:latitude] + mp "Missing #:longitude property in call to #center=.", force_color: :red unless params[:longitude] params[:animated] ||= true # Set the new region @@ -294,7 +294,7 @@ def look_up_location(location, &callback) geocoder = CLGeocoder.new geocoder.reverseGeocodeLocation(location, completionHandler: callback) else - PM.logger.info("You're trying to reverse geocode something that isn't a CLLocation") + mp "You're trying to reverse geocode something that isn't a CLLocation", force_color: :green callback.call nil, nil end end @@ -308,7 +308,7 @@ def mapView(map_view, didUpdateUserLocation:userLocation) if self.respond_to?(:on_user_location) on_user_location(userLocation) else - PM.logger.info "You're tracking the user's location but have not implemented the #on_user_location(location) method in MapScreen #{self.class.to_s}." + mp "You're tracking the user's location but have not implemented the #on_user_location(location) method in MapScreen #{self.class.to_s}.", force_color: :green end end diff --git a/spec/map_spec.rb b/spec/map_spec.rb index 7c5cd78..a6fc299 100644 --- a/spec/map_spec.rb +++ b/spec/map_spec.rb @@ -87,10 +87,7 @@ another_value: "Mark" } @map.add_annotation(ann) - old_lev = PM.logger.level - PM.logger.level = :none @map.annotations.last.another_value_fake.should == nil - PM.logger.level = old_lev end it "should clear annotations" do