diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-29 14:12:24 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-29 14:12:24 +0400 |
commit | c84675ee06dfc72c46c178ef40e30f03053dcc5a (patch) | |
tree | 02a967aff2806211f8946c2771e34a19832cabc4 | |
parent | 7121a58eb9e4dcb63d762e17a668f3bb4b0eaa85 (diff) |
satellites logs
-rw-r--r-- | lib/gitlab/satellite/logger.rb | 13 | ||||
-rw-r--r-- | lib/gitlab/satellite/satellite.rb | 9 |
2 files changed, 21 insertions, 1 deletions
diff --git a/lib/gitlab/satellite/logger.rb b/lib/gitlab/satellite/logger.rb new file mode 100644 index 00000000000..6f3f8255aca --- /dev/null +++ b/lib/gitlab/satellite/logger.rb @@ -0,0 +1,13 @@ +module Gitlab + module Satellite + class Logger < Gitlab::Logger + def self.file_name + 'satellites.log' + end + + def format_message(severity, timestamp, progname, msg) + "#{timestamp.to_s(:long)}: #{msg}\n" + end + end + end +end diff --git a/lib/gitlab/satellite/satellite.rb b/lib/gitlab/satellite/satellite.rb index d8e8f58963b..95273a6d208 100644 --- a/lib/gitlab/satellite/satellite.rb +++ b/lib/gitlab/satellite/satellite.rb @@ -13,6 +13,10 @@ module Gitlab @project = project end + def log message + Gitlab::Satellite::Logger.error(message) + end + def raise_no_satellite raise SatelliteNotExistError.new("Satellite doesn't exist") end @@ -29,10 +33,13 @@ module Gitlab output, status = popen("git clone #{project.url_to_repo} #{path}", Gitlab.config.satellites.path) + log("PID: #{project.id}: git clone #{project.url_to_repo} #{path}") + log("PID: #{project.id}: -> #{output}") + if status.zero? true else - Gitlab::GitLogger.error("Failed to create satellite for #{project.name_with_namespace}") + log("Failed to create satellite for #{project.name_with_namespace}") false end end |