Module: GClouder::Resources::Logging::Sinks::Local
- Includes:
- Config::CLIArgs, Config::Project, Logging
- Defined in:
- lib/gclouder/resources/logging/sinks.rb
Class Method Summary collapse
Methods included from Logging
#add, #bad, #change, #debug, #error, #fatal, #good, included, #info, log, loggers, #remove, report, #resource_state, setup, #warn, #warning
Methods included from Config::Project
Methods included from Helpers
#hash_to_args, included, #module_exists?, #to_arg, #to_deep_merge_hash, #valid_json?
Methods included from Config::CLIArgs
check, #cli_args, cli_args, included, load, valid_resources
Class Method Details
.list ⇒ Object
63 64 65 |
# File 'lib/gclouder/resources/logging/sinks.rb', line 63 def self.list GClouder::Resources::Global.instances(path: %w(logging sinks)) end |
.validate ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# 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 |