Class: Bridgetown::Rack::Logger
- Defined in:
- lib/bridgetown-core/rack/logger.rb
Class Method Summary collapse
Instance Method Summary collapse
- #add(severity, message = nil, progname = nil) ⇒ Object
- #enable_prefix ⇒ Object
-
#initialize(*_args) ⇒ Logger
constructor
A new instance of Logger.
Methods inherited from LogWriter
Constructor Details
#initialize(*_args) ⇒ Logger
Returns a new instance of Logger.
25 26 27 28 |
# File 'lib/bridgetown-core/rack/logger.rb', line 25 def initialize(*_args) super() enable_prefix end |
Class Method Details
.message_with_prefix(msg) ⇒ Object
9 10 11 |
# File 'lib/bridgetown-core/rack/logger.rb', line 9 def self.(msg) "\e[35m[Server]\e[0m #{msg}" end |
Instance Method Details
#add(severity, message = nil, progname = nil) ⇒ Object
19 20 21 22 23 |
# File 'lib/bridgetown-core/rack/logger.rb', line 19 def add(severity, = nil, progname = nil) return if progname&.include?("/_bridgetown/live_reload") super end |
#enable_prefix ⇒ Object
13 14 15 16 17 |
# File 'lib/bridgetown-core/rack/logger.rb', line 13 def enable_prefix @formatter = proc do |_, _, _, msg| self.class.(msg) end end |