Sha256: 4271af22815fbf8eb264bb3727d3358f7ba9a2cedff4d46bcdef8fc2b1828004
Contents?: true
Size: 611 Bytes
Versions: 22
Compression:
Stored size: 611 Bytes
Contents
require 'logger' module Netsoul module Logging # :nodoc: PREFIX = '[Netsoul-Ruby]'.freeze class << self attr_writer :logger end def self.logger @logger ||= ::Logger.new(STDERR).tap do |logger| logger.level = Logger::INFO logger.formatter = proc do |severity, datetime, _progname, msg| "#{severity} [#{datetime.strftime('%Y-%m-%d %H:%M:%S.%L'.freeze)}] #{msg}\n" end end end private def log(level, message) Netsoul::Logging.logger.send(level.to_sym, "#{PREFIX} #{message}") if Netsoul::Logging.logger end end end
Version data entries
22 entries across 22 versions & 1 rubygems