lib/ProMotion/logger/logger.rb in ProMotion-2.4.0 vs lib/ProMotion/logger/logger.rb in ProMotion-2.4.1
- old
+ new
@@ -36,14 +36,13 @@
LEVELS[self.level] || []
end
# Usage: PM.logger.log("ERROR", "message here", :red)
def log(label, message_text, color)
- # return if defined?(RUBYMOTION_ENV) && RUBYMOTION_ENV == "test"
- color = COLORS[color] || COLORS[:default]
- $stderr.puts color[0] + NAME + "[#{label}] #{message_text}" + color[1]
- nil
+ show_deprecation_warning
+
+ mp "#{NAME}[#{label}] #{message_text}", force_color: color
end
def error(message)
log('ERROR', message, :red) if self.levels.include?(:error)
end
@@ -60,9 +59,13 @@
log('DEBUG', message, :purple) if self.levels.include?(:debug)
end
def info(message)
log('INFO', message, :green) if self.levels.include?(:info)
+ end
+
+ def show_deprecation_warning
+ mp "PM.logger.log has been deprecated. Please update to motion_print: https://github.com/OTGApps/motion_print", force_color: :yellow
end
end
module_function