diff options
author | charlieablett <cablett@gitlab.com> | 2019-04-30 11:30:15 +0300 |
---|---|---|
committer | charlieablett <cablett@gitlab.com> | 2019-05-30 09:27:28 +0300 |
commit | 1f37aed1c917260eefda63a18d3a9af91c4a1abb (patch) | |
tree | a6912284b0984fb50a487a2e23ce6fbc0c3905d6 /lib/gitlab/graphql_logger.rb | |
parent | e33cab9f20971aa1b8076a4fef42e5022abe115f (diff) |
New logfile for graphql queries
Specify dedicated logfile and logger class for GraphQL queries. Move
complexity analyzer to a dedicated class.
Diffstat (limited to 'lib/gitlab/graphql_logger.rb')
-rw-r--r-- | lib/gitlab/graphql_logger.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/gitlab/graphql_logger.rb b/lib/gitlab/graphql_logger.rb new file mode 100644 index 00000000000..aff3ff5f48d --- /dev/null +++ b/lib/gitlab/graphql_logger.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Gitlab + class GraphqlLogger < Gitlab::Logger + def self.file_name_noext + 'graphql_json' + end + + # duration + # complexity + # depth + # sanitized variables (?) + # a structured representation of the query (?) + + def format_message(severity, timestamp, progname, msg) + "#{timestamp.to_s(:long)}: #{msg}\n" + end + end +end |