Sha256: 79b13375c6cc2192688b684c4718a19407fcfbcd93ce2107e9edbd6241b3cbd2

Contents?: true

Size: 1.05 KB

Versions: 251

Compression:

Stored size: 1.05 KB

Contents

# frozen_string_literal: true

require 'logger'

module PWN
  module Plugins
    # This plugin is used to instantiate a PWN logger with a custom message format
    module PWNLogger
      # Supported Method Parameters::
      # PWN::Plugins::PWNLogger.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

      # Author(s):: 0day Inc. <request.pentest@0dayinc.com>

      public_class_method def self.authors
        'AUTHOR(S):
          0day Inc. <request.pentest@0dayinc.com>
        '
      end

      # Display Usage for this Module

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

Version data entries

251 entries across 251 versions & 1 rubygems

Version Path
pwn-0.4.624 lib/pwn/plugins/pwn_logger.rb
pwn-0.4.623 lib/pwn/plugins/pwn_logger.rb
pwn-0.4.622 lib/pwn/plugins/pwn_logger.rb
pwn-0.4.621 lib/pwn/plugins/pwn_logger.rb
pwn-0.4.620 lib/pwn/plugins/pwn_logger.rb
pwn-0.4.619 lib/pwn/plugins/pwn_logger.rb
pwn-0.4.618 lib/pwn/plugins/pwn_logger.rb
pwn-0.4.617 lib/pwn/plugins/pwn_logger.rb
pwn-0.4.616 lib/pwn/plugins/pwn_logger.rb
pwn-0.4.615 lib/pwn/plugins/pwn_logger.rb
pwn-0.4.614 lib/pwn/plugins/pwn_logger.rb
pwn-0.4.613 lib/pwn/plugins/pwn_logger.rb
pwn-0.4.612 lib/pwn/plugins/pwn_logger.rb
pwn-0.4.611 lib/pwn/plugins/pwn_logger.rb
pwn-0.4.610 lib/pwn/plugins/pwn_logger.rb
pwn-0.4.609 lib/pwn/plugins/pwn_logger.rb
pwn-0.4.608 lib/pwn/plugins/pwn_logger.rb
pwn-0.4.607 lib/pwn/plugins/pwn_logger.rb
pwn-0.4.606 lib/pwn/plugins/pwn_logger.rb
pwn-0.4.605 lib/pwn/plugins/pwn_logger.rb