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.
27 28 29 30 |
# File 'lib/bridgetown-core/rack/logger.rb', line 27 def initialize(*_args) super() enable_prefix end |
Class Method Details
.message_with_prefix(msg) ⇒ Object
9 10 11 12 13 |
# File 'lib/bridgetown-core/rack/logger.rb', line 9 def self.(msg) # return if msg.include?("/_bridgetown/live_reload") "\e[35m[Server]\e[0m #{msg}" end |
Instance Method Details
#add(severity, message = nil, progname = nil) ⇒ Object
21 22 23 24 25 |
# File 'lib/bridgetown-core/rack/logger.rb', line 21 def add(severity, = nil, progname = nil) return if progname&.include?("/_bridgetown/live_reload") super end |
#enable_prefix ⇒ Object
15 16 17 18 19 |
# File 'lib/bridgetown-core/rack/logger.rb', line 15 def enable_prefix @formatter = proc do |_, _, _, msg| self.class.(msg) end end |