Sha256: 74455917c3dc057b2ba1943e08cc7200198321bd58d36ad2b0e6a6de30e29643

Contents?: true

Size: 778 Bytes

Versions: 142

Compression:

Stored size: 778 Bytes

Contents

# frozen_string_literal: true

require 'logger'

module Cryptum
  # This plugin is used to instantiate a Cryptum logger with a custom message format
  module Log
    # Supported Method Parameters::
    # Cryptum::Log.create(
    # )
    public_class_method def self.create
      logger = Logger.new($stdout)
      logger.level = Logger::INFO
      logger.datetime_format = '%Y-%m-%d %H:%M:%S'

      logger.formatter = proc do |severity, _datetime, _progname, msg|
        # TODO: Include datetime & progname vars
        "[#{severity}] #{msg}\n"
      end

      logger
    rescue StandardError => e
      raise e
    end

    # Display Usage for this Module

    public_class_method def self.help
      puts "USAGE:
        logger = #{self}.create()
      "
    end
  end
end

Version data entries

142 entries across 142 versions & 1 rubygems

Version Path
cryptum-0.0.254 lib/cryptum/log.rb
cryptum-0.0.253 lib/cryptum/log.rb
cryptum-0.0.252 lib/cryptum/log.rb
cryptum-0.0.251 lib/cryptum/log.rb
cryptum-0.0.250 lib/cryptum/log.rb
cryptum-0.0.249 lib/cryptum/log.rb
cryptum-0.0.248 lib/cryptum/log.rb
cryptum-0.0.247 lib/cryptum/log.rb
cryptum-0.0.246 lib/cryptum/log.rb
cryptum-0.0.245 lib/cryptum/log.rb
cryptum-0.0.244 lib/cryptum/log.rb
cryptum-0.0.243 lib/cryptum/log.rb
cryptum-0.0.242 lib/cryptum/log.rb
cryptum-0.0.241 lib/cryptum/log.rb
cryptum-0.0.240 lib/cryptum/log.rb
cryptum-0.0.239 lib/cryptum/log.rb
cryptum-0.0.238 lib/cryptum/log.rb
cryptum-0.0.234 lib/cryptum/log.rb
cryptum-0.0.233 lib/cryptum/log.rb
cryptum-0.0.232 lib/cryptum/log.rb