2012-05-26 12:37:49 +02:00
|
|
|
module Gitlab
|
2012-05-21 22:17:41 +02:00
|
|
|
class Logger
|
|
|
|
def self.error(message)
|
|
|
|
@@logger ||= ::Logger.new(File.join(Rails.root, "log/githost.log"))
|
2012-07-05 20:59:37 +02:00
|
|
|
message = Time.now.to_s(:long) + " -> " + message
|
2012-05-21 22:17:41 +02:00
|
|
|
@@logger.error(message)
|
|
|
|
end
|
2012-07-05 20:59:37 +02:00
|
|
|
|
|
|
|
def self.read_latest
|
|
|
|
path = Rails.root.join("log/githost.log")
|
|
|
|
logs = `tail -n 50 #{path}`.split("\n")
|
|
|
|
end
|
2012-05-21 22:17:41 +02:00
|
|
|
end
|
|
|
|
end
|