2012-05-26 06:37:49 -04:00
|
|
|
module Gitlab
|
2012-07-17 01:23:16 -04:00
|
|
|
class Logger < ::Logger
|
2012-05-21 16:17:41 -04:00
|
|
|
def self.error(message)
|
2012-07-17 01:23:16 -04:00
|
|
|
build.error(message)
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.info(message)
|
|
|
|
build.info(message)
|
2012-05-21 16:17:41 -04:00
|
|
|
end
|
2012-07-05 14:59:37 -04:00
|
|
|
|
|
|
|
def self.read_latest
|
2012-09-11 16:24:53 -04:00
|
|
|
path = Rails.root.join("log", file_name)
|
2012-07-21 10:30:09 -04:00
|
|
|
self.build unless File.exist?(path)
|
2012-11-28 23:49:11 -05:00
|
|
|
logs = `tail -n 2000 #{path}`.split("\n")
|
2012-07-05 14:59:37 -04:00
|
|
|
end
|
2012-07-17 01:23:16 -04:00
|
|
|
|
|
|
|
def self.build
|
2012-09-26 14:52:01 -04:00
|
|
|
new(Rails.root.join("log", file_name))
|
2012-07-17 01:23:16 -04:00
|
|
|
end
|
2012-05-21 16:17:41 -04:00
|
|
|
end
|
|
|
|
end
|