Module: SSLkeylog::Logging
- Defined in:
- lib/sslkeylog/logging.rb
Overview
This module configures logging used by SSL tracing
Class Attribute Summary collapse
-
.logger ⇒ Logger
The global logger used by SSL tracers.
Class Method Summary collapse
-
.default_formatter ⇒ Proc
Returns a default Logger formatter for NSS Key Log messages.
-
.default_logger ⇒ Logger
Returns a default Logger for NSS Key Log messages.
Class Attribute Details
.logger ⇒ Logger
The global logger used by SSL tracers
Must be set to an object that implements the interface provided by the
standard Ruby Logger
library.
13 14 15 |
# File 'lib/sslkeylog/logging.rb', line 13 def logger @logger end |
Class Method Details
.default_formatter ⇒ Proc
Returns a default Logger formatter for NSS Key Log messages
This formatter simply echoes any message without adding additional data such as timestamp, severity, etc.
22 23 24 25 26 |
# File 'lib/sslkeylog/logging.rb', line 22 def self.default_formatter Proc.new do |severity, datetime, progname, msg| msg end end |
.default_logger ⇒ Logger
Returns a default Logger for NSS Key Log messages
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/sslkeylog/logging.rb', line 34 def self.default_logger if ENV['SSLKEYLOG'] output = File.open(ENV['SSLKEYLOG'], 'a') # Flush output after every write as an external process, such as # Wireshark, may be watching this file. output.sync = true else output = $stderr end logger = Logger.new(output) logger.formatter = default_formatter logger end |