Sha256: 7b51820c2425cb20a59b746ef0100d9563daa073090e9f6febe1b26cfbf42167
Contents?: true
Size: 896 Bytes
Versions: 14
Compression:
Stored size: 896 Bytes
Contents
# frozen_string_literal: true require 'semantic_logger' module PUNK include SemanticLogger::Loggable def self.profile_info(name, **kwargs) logger.info "Started #{name}", kwargs.sanitize.inspect logger.measure_info("Completed #{name}") { logger.tagged(name) { yield } } end def self.profile_debug(name, **kwargs) logger.debug "Started #{name}", kwargs.sanitize.inspect logger.measure_debug("Completed #{name}") { logger.tagged(name) { yield } } end def self.profile_trace(name, **kwargs) logger.trace "Started #{name}", kwargs.sanitize.inspect logger.measure_trace("Completed #{name}") { logger.tagged(name) { yield } } end SemanticLogger.default_level = case PUNK.store.args.task when 'console', 'script' :info when 'spec' :debug else :trace end SemanticLogger.add_appender(io: $stdout, formatter: :color) end
Version data entries
14 entries across 14 versions & 1 rubygems