Sha256: fbb3a8f9cea2674b389001433a5c54f0fa4c540731b32efdfd49e7be78c92934
Contents?: true
Size: 670 Bytes
Versions: 3
Compression:
Stored size: 670 Bytes
Contents
# frozen_string_literal: true require 'logger' module Netsoul module Logging # :nodoc: PREFIX = '[Netsoul-Ruby]'.freeze class << self attr_writer :logger end def self.logger @logger ||= ::Logger.new(STDOUT).tap do |logger| $stdout.sync = true 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
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
netsoul-2.4.2 | lib/netsoul/logging.rb |
netsoul-2.4.1 | lib/netsoul/logging.rb |
netsoul-2.3.8 | lib/netsoul/logging.rb |