Module: EasyML::Logging

Included in:
Data::Dataset
Defined in:
lib/easy_ml/logging.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



3
4
5
# File 'lib/easy_ml/logging.rb', line 3

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#log_info(message) ⇒ Object



34
35
36
# File 'lib/easy_ml/logging.rb', line 34

def log_info(message)
  puts "\e[34mINFO: #{message}\e[0m"
end

#log_message(message, verbose: false) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/easy_ml/logging.rb', line 18

def log_message(message, verbose: false)
  if verbose
    log_verbose(message)
  else
    puts message
  end
end

#log_verbose(message) ⇒ Object



26
27
28
# File 'lib/easy_ml/logging.rb', line 26

def log_verbose(message)
  puts message if @verbose
end

#log_warning(message) ⇒ Object



30
31
32
# File 'lib/easy_ml/logging.rb', line 30

def log_warning(message)
  puts "\e[33mWARNING: #{message}\e[0m"
end