Module: Logging

Included in:
GithubApi
Defined in:
lib/org_lang_stats/logging.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.loggerObject



5
6
7
8
9
10
11
12
# File 'lib/org_lang_stats/logging.rb', line 5

def self.logger
    @logger ||= begin
        maybe_logger = Logger.new(STDOUT)
        maybe_logger.formatter = proc { |severity, datetime, msg| "#{severity} - #{datetime.strftime('%H:%M:%S')} - #{msg}\n" }
        maybe_logger.level = Logger::ERROR
        maybe_logger
    end
end

Instance Method Details

#enableObject



18
19
20
# File 'lib/org_lang_stats/logging.rb', line 18

def enable
    Logging.logger.level = Logger::DEBUG
end

#loggerObject



14
15
16
# File 'lib/org_lang_stats/logging.rb', line 14

def logger
    Logging.logger
end