Skip to content
This repository has been archived by the owner on Oct 2, 2019. It is now read-only.

Commit

Permalink
feature: New log formatting (#29)(#22)
Browse files Browse the repository at this point in the history
A more human readable logging output.
  • Loading branch information
mauricioabreu authored and marceloboeira committed Aug 21, 2016
1 parent 3c31404 commit 836a27b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/bojack/server.cr
Expand Up @@ -8,7 +8,11 @@ module BoJack
@hostname : String
@port : Int8 | Int16 | Int32 | Int64

def initialize(@hostname = "127.0.0.1", @port = 5000, @logger = Logger.new(STDOUT)); end
def initialize(@hostname = "127.0.0.1", @port = 5000, @logger = Logger.new(STDOUT))
@logger.formatter = Logger::Formatter.new do |severity, datetime, progname, message, io|
io << "[bojack][#{hostname}:#{port}][#{datetime}][#{severity}] #{message}"
end
end

def start
server = TCPServer.new(@hostname, @port)
Expand Down

0 comments on commit 836a27b

Please sign in to comment.