6035ad7e1f
This resolves issue #1121. Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
25 lines
550 B
Ruby
25 lines
550 B
Ruby
module Gitlab
|
|
class Logger < ::Logger
|
|
def self.error(message)
|
|
build.error(message)
|
|
end
|
|
|
|
def self.info(message)
|
|
build.info(message)
|
|
end
|
|
|
|
def self.read_latest
|
|
path = Rails.root.join("log/githost.log")
|
|
self.build unless File.exist?(path)
|
|
logs = File.read(path).split("\n")
|
|
end
|
|
|
|
def self.build
|
|
new(File.join(Rails.root, "log/githost.log"))
|
|
end
|
|
|
|
def format_message(severity, timestamp, progname, msg)
|
|
"#{timestamp.to_s(:long)} -> #{severity} -> #{msg}\n"
|
|
end
|
|
end
|
|
end
|