lib/slim_lint/logger.rb in slim_lint-0.5.0 vs lib/slim_lint/logger.rb in slim_lint-0.6.0
- old
+ new
@@ -20,67 +20,65 @@
# Print the specified output.
#
# @param output [String] the output to send
# @param newline [true,false] whether to append a newline
- # @return [nil]
def log(output, newline = true)
@out.print(output)
@out.print("\n") if newline
end
# Print the specified output in bold face.
# If output destination is not a TTY, behaves the same as {#log}.
#
# @param args [Array<String>]
- # @return [nil]
def bold(*args)
color('1', *args)
end
# Print the specified output in a color indicative of error.
# If output destination is not a TTY, behaves the same as {#log}.
#
# @param args [Array<String>]
- # @return [nil]
def error(*args)
color(31, *args)
end
# Print the specified output in a bold face and color indicative of error.
# If output destination is not a TTY, behaves the same as {#log}.
#
# @param args [Array<String>]
- # @return [nil]
def bold_error(*args)
color('1;31', *args)
end
# Print the specified output in a color indicative of success.
# If output destination is not a TTY, behaves the same as {#log}.
#
# @param args [Array<String>]
- # @return [nil]
def success(*args)
color(32, *args)
end
# Print the specified output in a color indicative of a warning.
# If output destination is not a TTY, behaves the same as {#log}.
#
# @param args [Array<String>]
- # @return [nil]
def warning(*args)
color(33, *args)
end
# Print the specified output in a color indicating information.
# If output destination is not a TTY, behaves the same as {#log}.
#
# @param args [Array<String>]
- # @return [nil]
def info(*args)
color(36, *args)
+ end
+
+ # Print a blank line.
+ def newline
+ log('')
end
# Whether this logger is outputting to a TTY.
#
# @return [true,false]