<commit_before># If you ever get annoyed by the output you can set the log level to info.
# Note that you will *not* see what failed, though!
# set :log_level, :info

require 'logging'

module BenderLogger
  def self.logger
    @logger ||= logger!
  end

  def self.logger!
    Logging.color_scheme 'bright', date: :blue, logger: :magenta, message: :white
    layout = Logging.layouts.pattern pattern: pattern, color_scheme: 'bright'
    Logging.appenders.stdout 'stdout', auto_flushing: true, layout: layout

    result = Logging.logger['CAP']
    result.add_appenders 'stdout'
    result.level = fetch(:log_level)
    result
  end

  def self.pattern
    ['▬' * 72, ' \n%m\n', '▬' * 72, '\n']
  end
end

def logger
  BenderLogger.logger
end

ENV['SSHKIT_COLOR'] = 'true'

module SSHKit
  module Formatter
    class Pretty
      def prefix(command)
        %(#{c.green(command.uuid)}  #{c.blue(command.host.to_s.ljust(15))})
      end

      def write_command(command) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
        unless command.started?
          original_output << %(#{prefix(command)} #{c.yellow(c.bold(command.to_command))}\n)
        end

        unless command.stdout.empty?
          command.stdout.lines.each do |line|
            original_output << %(#{prefix(command)} #{line})
            original_output << "\n" unless line[-1] == "\n"
          end
        end
<commit_msg>Fix: logger pattern must be a string<commit_after># If you ever get annoyed by the output you can set the log level to info.
# Note that you will *not* see what failed, though!
# set :log_level, :info

require 'logging'

module BenderLogger
  def self.logger
    @logger ||= logger!
  end

  def self.logger!
    Logging.color_scheme 'bright', date: :blue, logger: :magenta, message: :white
    layout = Logging.layouts.pattern pattern: pattern, color_scheme: 'bright'
    Logging.appenders.stdout 'stdout', auto_flushing: true, layout: layout

    result = Logging.logger['CAP']
    result.add_appenders 'stdout'
    result.level = fetch(:log_level)
    result
  end

  def self.pattern
    ['▬' * 72, ' \n%m\n', '▬' * 72, '\n'].join
  end
end

def logger
  BenderLogger.logger
end

ENV['SSHKIT_COLOR'] = 'true'

module SSHKit
  module Formatter
    class Pretty
      def prefix(command)
        %(#{c.green(command.uuid)}  #{c.blue(command.host.to_s.ljust(15))})
      end

      def write_command(command) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
        unless command.started?
          original_output << %(#{prefix(command)} #{c.yellow(c.bold(command.to_command))}\n)
        end

        unless command.stdout.empty?
          command.stdout.lines.each do |line|
            original_output << %(#{prefix(command)} #{line})
            original_output << "\n" unless line[-1] == "\n"
          end
        end

{'fraction_non_alphanumeric': 0.1295774647887324, 'fraction_numerical': 0.004929577464788733, 'mean_word_length': 2.990168539325843, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6917028', 'n_tokens_mistral': 939, 'n_tokens_neox': 912, 'n_words': 248}