aboutsummaryrefslogtreecommitdiff
path: root/core/logger.rb
diff options
context:
space:
mode:
Diffstat (limited to 'core/logger.rb')
-rw-r--r--core/logger.rb26
1 files changed, 11 insertions, 15 deletions
diff --git a/core/logger.rb b/core/logger.rb
index d73cd15..086967c 100644
--- a/core/logger.rb
+++ b/core/logger.rb
@@ -5,33 +5,29 @@ module Dinobot
@@mutex = Mutex.new
def in(*lines)
- str = lines.join("\n")
-
- puts str.gsub(/^/, "\e[32m<<\e[0m ")
+ pout("\e[32m<<\e[0m ", *lines)
end
def out(*lines)
- str = lines.join("\n")
+ pout("\e[36m>>\e[0m ", *lines)
+ end
- puts str.gsub(/^/, "\e[36m>>\e[0m ")
+ def info(*lines)
+ pout("\e[33m==\e[0m ", *lines)
end
def error(*lines)
- str = lines.join("\n")
-
- puts str.gsub(/^/, "\e[31m!!\e[0m ")
+ pout("\e[31m!!\e[0m ", *lines)
end
- def info(*lines)
- str = lines.join("\n")
-
- puts str.gsub(/^/, "\e[33m==\e[0m ")
+ def indent(*lines)
+ pout(' ', *lines)
end
- def indent(*lines)
- str = lines.join("\n")
+ private
- puts str.gsub(/^/, ' ')
+ def pout(prefix, *lines)
+ puts lines.join("\n").gsub(/^/, prefix)
end
class << self