From 974e6fda833fdb362ab92da65a5b34a6436798c4 Mon Sep 17 00:00:00 2001 From: pvincent Date: Fri, 5 Jan 2024 14:01:02 +0400 Subject: [PATCH] ANSI_CODE --- lib/formatters/basic_formatter.rb | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/formatters/basic_formatter.rb b/lib/formatters/basic_formatter.rb index c773759..32ed589 100644 --- a/lib/formatters/basic_formatter.rb +++ b/lib/formatters/basic_formatter.rb @@ -3,19 +3,19 @@ class BasicFormatter < SemanticLogger::Formatters::Color ANSI_REVERSED_WARNING = "\e[0;30;43m".freeze ANSI_REVERSED_ERROR = "\e[1;30;41m".freeze ANSI_REVERSED_FATAL = "\e[1;30;41m".freeze - ANSI_GRAY = "\e[90m".freeze - ANSI_GREEN = SemanticLogger::AnsiColors::GREEN - ANSI_YELLOW = SemanticLogger::AnsiColors::YELLOW - ANSI_RED = SemanticLogger::AnsiColors::RED - ANSI_MAGENTA = SemanticLogger::AnsiColors::MAGENTA + ANSI_DEBUG = "\e[90m".freeze + ANSI_INFO = SemanticLogger::AnsiColors::GREEN + ANSI_WARN = SemanticLogger::AnsiColors::YELLOW + ANSI_ERROR = SemanticLogger::AnsiColors::RED + ANSI_FATAL = SemanticLogger::AnsiColors::MAGENTA def initialize super(time_format: nil, color_map: ColorMap.new( - debug: ANSI_GRAY, - info: ANSI_GREEN, - warn: ANSI_YELLOW, - fatal: ANSI_RED + debug: ANSI_DEBUG, + info: ANSI_INFO, + warn: ANSI_WARN, + fatal: ANSI_ERROR )) end @@ -44,7 +44,8 @@ class BasicFormatter < SemanticLogger::Formatters::Color end def name - "#{color}#{log.name.ljust(20)}#{color_map.clear}" + # "#{color}#{log.name.ljust(20)}#{color_map.clear}" + "#{ANSI_DEBUG}#{log.name.rjust(20)}#{color_map.clear}" end def process_info