Class: GoogleSslCert::Logger
- Inherits:
-
Logger
- Object
- Logger
- GoogleSslCert::Logger
- Defined in:
- lib/google_ssl_cert/logger.rb
Instance Method Summary collapse
- #format_message(severity, datetime, progname, msg) ⇒ Object
-
#initialize(*args) ⇒ Logger
constructor
A new instance of Logger.
- #log_level ⇒ Object
Constructor Details
#initialize(*args) ⇒ Logger
Returns a new instance of Logger.
5 6 7 8 9 |
# File 'lib/google_ssl_cert/logger.rb', line 5 def initialize(*args) super self.formatter = Formatter.new self.level = log_level end |
Instance Method Details
#format_message(severity, datetime, progname, msg) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/google_ssl_cert/logger.rb', line 19 def (severity, datetime, progname, msg) line = if @logdev.dev == $stdout || @logdev.dev == $stderr msg # super simple format if stdout else super # use the configured formatter end line =~ /\n$/ ? line : "#{line}\n" end |
#log_level ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/google_ssl_cert/logger.rb', line 11 def log_level if ENV['DEBUG'] :debug else ENV['GSC_LOG_LEVEL'] || :info # note: only respected when config.logger not set in config/app.rb end end |