<commit_before># Provides logging services for the base server.
#
module Servitude
  module ServerLogging

  protected

    def initialize_loggers
      Servitude.initialize_loggers log_level: log_level
    end

    def log_startup
      start_banner.each do |line|
        Servitude.logger.info line
      end
    end

    def start_banner
      [
        "",
        "***",
        "* #{Servitude::APP_NAME} started",
        "*",
        "* #{Servitude::ATTRIBUTION}",
        "*",
        (Servitude.configuration.empty? ? nil : "* Configuration"),
        PrettyPrint::configuration_lines( Servitude.configuration, "*  ", all_config_filters ),
        (Servitude.configuration.empty? ? nil : "*"),
        "***",
      ].flatten.reject( &:nil? )
    end

    def log_level
      (Servitude.configuration.log_level.to_sym rescue :info)
    end

    def all_config_filters
      default_config_filters + config_filters
    end

    def default_config_filters
      %w(
        help
        interactive
      )
    end

    # Override for custom config filtering
    #
    def config_filters
      []
    end

    #def config_value( key )
      #value = Servitude.configuration.send( key )

      #return value unless value.is_a?( Hash )
<commit_msg>Fix issue with start banner when no configuration in use.<commit_after># Provides logging services for the base server.
#
module Servitude
  module ServerLogging

  protected

    def initialize_loggers
      Servitude.initialize_loggers log_level: log_level
    end

    def log_startup
      start_banner.each do |line|
        Servitude.logger.info line
      end
    end

    def start_banner
      [
        "",
        "***",
        "* #{Servitude::APP_NAME} started",
        "*",
        "* #{Servitude::ATTRIBUTION}",
        "*",
        ((Servitude.configuration.nil? || Servitude.configuration.empty?) ? nil : "* Configuration"),
        PrettyPrint::configuration_lines( Servitude.configuration, "*  ", all_config_filters ),
        ((Servitude.configuration.nil? || Servitude.configuration.empty?) ? nil : "*"),
        "***",
      ].flatten.reject( &:nil? )
    end

    def log_level
      (Servitude.configuration.log_level.to_sym rescue :info)
    end

    def all_config_filters
      default_config_filters + config_filters
    end

    def default_config_filters
      %w(
        help
        interactive
      )
    end

    # Override for custom config filtering
    #
    def config_filters
      []
    end

    #def config_value( key )
      #value = Servitude.configuration.send( key )

      #return value unless value.is_a?( Hash )

{'fraction_non_alphanumeric': 0.10053516819571866, 'fraction_numerical': 0.0, 'mean_word_length': 2.3168567807351077, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3198919', 'n_tokens_mistral': 761, 'n_tokens_neox': 751, 'n_words': 171}