module GClouder::Resources::Logging::Sinks::Local

Public Class Methods

list() click to toggle source
# File lib/gclouder/resources/logging/sinks.rb, line 63
def self.list
  GClouder::Resources::Global.instances(path: %w(logging sinks))
end
validate() click to toggle source
# File lib/gclouder/resources/logging/sinks.rb, line 40
def self.validate
  return if list.empty?

  failure = false

  list.each do |region, sinks|
    info region, indent: 2, heading: true
    sinks.each do |sink|
      info sink["name"], indent: 3, heading: true
      if !sink["name"].is_a?(String)
        bad "#{sink['name']} is incorrect type #{sink['name'].class}, should be: String", indent: 4
        failure = true
      end

      if cli_args[:debug] || !cli_args[:output_validation]
        good "name is a String", indent: 4
      end
    end
  end

  fatal "\nerror: validation failure" if failure
end