mirror of
https://github.com/zhigang1992/ProMotion.git
synced 2026-05-03 22:44:47 +08:00
1.3 KiB
1.3 KiB
Contents
Usage
The ProMotion logger handles debugging and informational output to the REPL. It is accessible from ProMotion.logger or PM.logger. You can also set a new logger by setting PM.logger = MyLogger.new.
def some_method
PM.logger.error "My error"
PM.logger.deprecated "Deprecation warning"
PM.logger.warn "My warning"
PM.logger.debug @some_object
PM.logger.info "Some info #{@object}"
PM.logger.log("My Custom Error", "My Message", :red)
end
Methods
log(label, message_text, color)
Output a colored console message.
PM.logger.log("TESTING", "This is red!", :red)
error(message)
Output a red colored console error.
PM.logger.error("This is an error")
deprecated(message)
Output a yellow colored console deprecated.
PM.logger.deprecated("This is a deprecation warning.")
warn(message)
Output a yellow colored console warning.
PM.logger.warn("This is a warning")
debug(message)
Output a purple colored console debug message.
PM.logger.debug(@some_var)
info(message)
Output a green colored console info message.
PM.logger.info("This is an info message")
Class Methods
None.
Accessors
None.