lib/dply/custom_logger.rb in dply-0.2.19 vs lib/dply/custom_logger.rb in dply-0.3.0
- old
+ new
@@ -1,15 +1,17 @@
require 'logger'
-require 'dply/ext/string'
+require_relative 'ext/string'
+
module Dply
class CustomLogger < ::Logger
attr_writer :trace_mode, :remote_mode, :enable_markers
def initialize(file)
super(file)
@level = ::Logger::INFO
+# @trace_mode = false
end
def format_message(severity, timestamp, progname, msg)
case severity
when "INFO"
@@ -19,9 +21,24 @@
when "WARN"
"#{severity.downcase.bold.yellow} #{msg}\n"
else
"#{severity[0].bold.blue} #{msg}\n"
end
+ end
+
+ def command(command, mode:)
+ case mode
+ when :arrow
+ arrow command
+ when :bullet
+ bullet command
+ else
+ debug command
+ end
+ end
+
+ def arrow(msg)
+ info "#{"\u2023".green.bold} #{msg}"
end
def bullet(msg)
info "#{"\u2219".bold.blue} #{msg}"
end