Class: Gitlab::BackupLogger
- Inherits:
-
Object
- Object
- Gitlab::BackupLogger
- Defined in:
- lib/gitlab/backup_logger.rb
Instance Attribute Summary collapse
-
#json_logger ⇒ Object
readonly
Returns the value of attribute json_logger.
-
#progress ⇒ Object
readonly
Returns the value of attribute progress.
Instance Method Summary collapse
- #error(message) ⇒ Object
- #flush ⇒ Object
- #info(message) ⇒ Object
-
#initialize(progress) ⇒ BackupLogger
constructor
A new instance of BackupLogger.
- #warn(message) ⇒ Object
Constructor Details
#initialize(progress) ⇒ BackupLogger
Returns a new instance of BackupLogger.
7 8 9 10 |
# File 'lib/gitlab/backup_logger.rb', line 7 def initialize(progress) @progress = progress @json_logger = ::Gitlab::Backup::JsonLogger.build end |
Instance Attribute Details
#json_logger ⇒ Object (readonly)
Returns the value of attribute json_logger.
5 6 7 |
# File 'lib/gitlab/backup_logger.rb', line 5 def json_logger @json_logger end |
#progress ⇒ Object (readonly)
Returns the value of attribute progress.
5 6 7 |
# File 'lib/gitlab/backup_logger.rb', line 5 def progress @progress end |
Instance Method Details
#error(message) ⇒ Object
24 25 26 27 28 |
# File 'lib/gitlab/backup_logger.rb', line 24 def error() progress.puts Rainbow("#{Time.zone.now} -- #{}").red json_logger.error(message: ) end |
#flush ⇒ Object
30 31 32 |
# File 'lib/gitlab/backup_logger.rb', line 30 def flush progress.flush end |
#info(message) ⇒ Object
18 19 20 21 22 |
# File 'lib/gitlab/backup_logger.rb', line 18 def info() progress.puts Rainbow("#{Time.zone.now} -- #{}").cyan json_logger.info(message: ) end |
#warn(message) ⇒ Object
12 13 14 15 16 |
# File 'lib/gitlab/backup_logger.rb', line 12 def warn() progress.puts Rainbow("#{Time.zone.now} -- #{}").yellow json_logger.warn(message: ) end |