Welcome to mirror list, hosted at ThFree Co, Russian Federation.

diagnostic_reports_logger.rb « memory « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cc5b719fa19b8ab87ef940ff147cb83c22f16575 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

require 'logger'

module Gitlab
  module Memory
    class DiagnosticReportsLogger < ::Logger
      def format_message(severity, timestamp, progname, message)
        data = {}
        data[:severity] = severity
        data[:time] = timestamp.utc.iso8601(3)

        data.merge!(message)

        "#{JSON.generate(data)}\n" # rubocop:disable Gitlab/Json
      end
    end
  end
end