Commit c84675ee06dfc72c46c178ef40e30f03053dcc5a

Authored by Dmitriy Zaporozhets
1 parent 7121a58e

satellites logs

lib/gitlab/satellite/logger.rb 0 → 100644
... ... @@ -0,0 +1,13 @@
  1 +module Gitlab
  2 + module Satellite
  3 + class Logger < Gitlab::Logger
  4 + def self.file_name
  5 + 'satellites.log'
  6 + end
  7 +
  8 + def format_message(severity, timestamp, progname, msg)
  9 + "#{timestamp.to_s(:long)}: #{msg}\n"
  10 + end
  11 + end
  12 + end
  13 +end
... ...
lib/gitlab/satellite/satellite.rb
... ... @@ -13,6 +13,10 @@ module Gitlab
13 13 @project = project
14 14 end
15 15  
  16 + def log message
  17 + Gitlab::Satellite::Logger.error(message)
  18 + end
  19 +
16 20 def raise_no_satellite
17 21 raise SatelliteNotExistError.new("Satellite doesn't exist")
18 22 end
... ... @@ -29,10 +33,13 @@ module Gitlab
29 33 output, status = popen("git clone #{project.url_to_repo} #{path}",
30 34 Gitlab.config.satellites.path)
31 35  
  36 + log("PID: #{project.id}: git clone #{project.url_to_repo} #{path}")
  37 + log("PID: #{project.id}: -> #{output}")
  38 +
32 39 if status.zero?
33 40 true
34 41 else
35   - Gitlab::GitLogger.error("Failed to create satellite for #{project.name_with_namespace}")
  42 + log("Failed to create satellite for #{project.name_with_namespace}")
36 43 false
37 44 end
38 45 end
... ...