gitlabhq/lib/gitlab/logger.rb

22 lines
419 B
Ruby
Raw Normal View History

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
2012-09-11 22:24:53 +02:00
path = Rails.root.join("log", file_name)
self.build unless File.exist?(path)
2012-11-29 05:49:11 +01:00
logs = `tail -n 2000 #{path}`.split("\n")
end
def self.build
2012-09-26 20:52:01 +02:00
new(Rails.root.join("log", file_name))
end
end
end