Module: PWN::Plugins::PWNLogger

Defined in:
lib/pwn/plugins/pwn_logger.rb

Overview

This plugin is used to instantiate a PWN logger with a custom message format

Class Method Summary collapse

Class Method Details

.authorsObject

Author(s)

0day Inc. <[email protected]>



30
31
32
33
34
# File 'lib/pwn/plugins/pwn_logger.rb', line 30

public_class_method def self.authors
  'AUTHOR(S):
    0day Inc. <[email protected]>
  '
end

.createObject

Supported Method Parameters

PWN::Plugins::PWNLogger.create( )



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/pwn/plugins/pwn_logger.rb', line 13

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

.helpObject

Display Usage for this Module



38
39
40
41
42
43
# File 'lib/pwn/plugins/pwn_logger.rb', line 38

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