Class: Statique::CLI::Server::LoggerWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/statique/cli/server.rb

Instance Method Summary collapse

Instance Method Details

#<<(msg) ⇒ Object



7
8
9
10
# File 'lib/statique/cli/server.rb', line 7

def <<(msg)
  method, uri, status, time, content_type = msg.chomp.split(":")
  log(:info, "#{method} #{uri}", status: status.to_i, time: time.to_f, content_type:)
end

#log(type, msg, attrs = {}) ⇒ Object



12
13
14
# File 'lib/statique/cli/server.rb', line 12

def log(type, msg, attrs = {})
  Statique.ui.public_send(type, msg, attrs.merge(app: "webrick"))
end