# Whoop.setup do |config| # config.logger = ActiveSupport::Logger.new("#{Rails.root}/log/debug.log") # config.level = :debug # end module Whoop VERSION: untyped # sord omit - no YARD return type given, using untyped # Configure the logger def self.setup: () -> untyped module Main COLORS: untyped FORMATS: untyped PATTERN: untyped COUNT: untyped INDENT: untyped TOP_LINE_CHAR: untyped BOTTOM_LINE_CHAR: untyped # sord omit - no YARD return type given, using untyped # Log the message to the logger # # _@param_ `label` — (optional) - the label or object to log # # _@param_ `pattern` — - the pattern to use for the line (e.g. '-') # # _@param_ `count` — - the number of times to repeat the pattern per line (e.g. 80) # # _@param_ `color` — - the color to use for the line (e.g. :red) # # _@param_ `format` — - the format to use for the message (one of :json, :sql, :plain) # # _@param_ `caller_depth` — - the depth of the caller to use for the source (default: 0) # # _@param_ `explain` — - whether to explain the SQL query (default: false) # # _@param_ `context` — - Any additional context you'd like to include in the log def whoop: ( ?String? label, ?pattern: String, ?count: Integer, ?color: Symbol, ?format: Symbol, ?caller_depth: Integer, ?explain: bool, ?context: ::Hash[untyped, untyped]? ) -> untyped # Remove the Rails.root from the caller path # # _@param_ `caller_path` — - path of the the file and line number of the caller def clean_caller_path: (String caller_path) -> String # Detect the colorize method to use # # _@param_ `color` # # _@return_ — the colorize method def detect_color_method: (Symbol color) -> Method # Detect the logger method to use # # _@return_ — logger method def detect_logger_method: () -> Method # sord omit - no YARD type given for "colorize:", using untyped # sord omit - no YARD type given for "explain:", using untyped # Return the format method to use # # _@param_ `format` # # _@return_ — format method def detect_formatter_method: (Symbol format, ?colorize: untyped, ?explain: untyped) -> Method # sord omit - no YARD type given for "format", using untyped # sord omit - no YARD type given for "color_method", using untyped # sord omit - no YARD type given for "logger_method", using untyped # sord omit - no YARD return type given, using untyped def display_invalid_format_message: (untyped format, untyped color_method, untyped logger_method) -> untyped # Return the line with the label centered in it # # _@param_ `label` # # _@param_ `count` # # _@param_ `pattern` def wrapped_line: (String label, ?count: Integer, ?pattern: String) -> String end module Formatters module SqlFormatter PATTERNS_TO_PRESERVE: untyped # Format the SQL query # # _@param_ `sql` — The SQL query # # _@param_ `colorize` — - colorize the SQL query (default: false) # # _@param_ `explain` — - also run `EXPLAIN` on the query (default: false) # # _@return_ — The formatted SQL query def self.format: (String sql, ?colorize: bool, ?explain: bool) -> String # Generate a pretty SQL query # # _@param_ `sql` — The SQL query # # _@return_ — The formatted SQL query def self.generate_pretty_sql: (String sql) -> String # Execute the `EXPLAIN` query # # _@param_ `sql` — The SQL query # # _@return_ — The formatted query plan def self.exec_explain: (String sql) -> String end module JsonFormatter # Format the SQL query # # _@param_ `message` — The SQL query # # _@param_ `colorize` — - colorize the SQL query (default: false) # # _@return_ — The formatted SQL query def self.format: (String message, ?colorize: bool) -> String end end end