mirror of
https://github.com/gitlabhq/gitlabhq.git
synced 2025-08-01 16:46:16 +00:00
40 lines
644 B
Ruby
40 lines
644 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Gitlab
|
|
class BackupLogger < Gitlab::JsonLogger
|
|
exclude_context!
|
|
|
|
attr_reader :progress
|
|
|
|
def initialize(progress)
|
|
@progress = progress
|
|
end
|
|
|
|
def warn(message)
|
|
progress.puts "#{Time.zone.now} -- #{message}".color(:yellow)
|
|
|
|
super
|
|
end
|
|
|
|
def info(message)
|
|
progress.puts "#{Time.zone.now} -- #{message}".color(:cyan)
|
|
|
|
super
|
|
end
|
|
|
|
def error(message)
|
|
progress.puts "#{Time.zone.now} -- #{message}".color(:red)
|
|
|
|
super
|
|
end
|
|
|
|
def flush
|
|
progress.flush
|
|
end
|
|
|
|
def self.file_name_noext
|
|
'backup_json'
|
|
end
|
|
end
|
|
end
|